📄 removemessage.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.util.*,
java.text.*,
com.powerrun.shortmsg.*,
com.powerrun.ioffice.*,
com.powerrun.util.*,
com.powerrun.ioffice.util.*"
errorPage="error.jsp"
%>
<jsp:useBean id="messageBean" scope="session"
class="com.powerrun.shortmsg.messagebean.MessageBean"/>
<% ////////////////////////
// Authorization check
// check for the existence of an authorization token
Authorization authToken = SkinUtils.getUserAuthorization(request,response);
//Authorization authToken = AuthorizationFactory.getAuthorization("root", "123");
if( authToken == null ) {
response.sendRedirect("../login.jsp?referer=index.jsp");
return;
}
%>
<% ////////////////////
// Security check
// make sure the user is authorized to administer users:
IofficeFactory iofficeFactory = IofficeFactory.getInstance(authToken);
ProfileManager manager = iofficeFactory.getProfileManager();
%>
<% ////////////////////
// get parameters
String messageID = ParamUtils.getParameter(request,"messageID");
String start = ParamUtils.getParameter(request,"start");
String range = ParamUtils.getParameter(request,"range");
int messageid= Integer.parseInt(messageID);
boolean doDelete = ParamUtils.getBooleanParameter(request,"doDelete");
%>
<% //////////////////////////////////
// global error variables
String errorMessage = "";
%>
<% /////////////////////
// delete if specified
if( doDelete ) {
ComponentManager cpman = iofficeFactory.getComponentManager();
IofficeComponent cp = cpman.getComponent( "message" );
ShortMsgAgent agent =(ShortMsgAgent) cp.getAgentInstance();
try {
agent.removeUsermessage(messageid);
}
catch( MessageNotFoundException fnfe ) {
errorMessage = "No message found";
}
response.sendRedirect("main.jsp?start="+start+"&range="+range);
return;
}
%>
<%
String ipaddr = request.getRemoteAddr();
session.putValue("doThing","删除短信");
iofficeFactory.reportPulse(ipaddr,"删除短信");
%>
<html>
<head> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title></title>
<style>
<!--
table{ font-family: 宋体; font-size: 10pt }
a:link{ font-family: 宋体; font-size: 10pt; color: #000000; text-decoration: none }
a:visited{ font-family: 宋体; font-size: 10pt; color: #000000; text-decoration: none }
a:hover{ font-family: 宋体; font-size: 10pt; color: red; text-decoration:underline }
-->
</style>
</head>
<body topmargin="0" leftmargin="0" >
<table border="0" cellpadding="0" cellspacing="0" width="770">
<tr>
<td width="91" background="../images/rq21.gif" valign="top"><img border="0" src="../images/rq20.gif" width="144" height="339">
<p> </td>
<td width="675" valign="top">
<div align="right">
<table width="100%">
<tr>
<td vAlign="bottom" width="100%">
<img border="0" src="images/duanxin.gif" width="622" height="51">
</td>
</tr>
<tr>
<td width="100%" height="30">
</td>
</tr>
<tr>
<td width="100%">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="90%">
<tr>
<td width="100%" bgcolor="#eeeeee" height="35">
<% ///////////////////////
String[] pageTitleInfo = { "信件管理", "删除信件" };
%>
<%-- header --%>
<% if( pageTitleInfo != null ) { %>
<table bgcolor="#BFDFFF" cellpadding="1" cellspacing="0" border="0" width="100%">
<td><table bgcolor="#BFDFFF" cellpadding="3" cellspacing="0" border="0" width="100%">
<td>
<% for( int i=0; i<pageTitleInfo.length; i++ ){ %>
<%= pageTitleInfo[i] %>
<% if( (i+1)<pageTitleInfo.length ) { %>
:
<% } %>
<% } %>
</td>
</table></td>
</table>
<% } %>
<p>
<%//style="font-weight:bold;"
Message msg=new Message(messageid);
String messageName=msg.getSubject();
%>
<font color=blue><b> 删除 <%= messageName %></b></font>
<ul>
警告: 本操作将从信箱中永久性的删除信件:<b><font color="FF8000">[<%= messageName %>]</font></b>, 请确认是否删除该信件!
</ul></td>
</tr>
<tr>
<td width="100%" bgcolor="#eeeeee">
<div align="center">
<form action="removeMessage.jsp" name="deleteForm" method="post">
<input type="hidden" name="doDelete" value="true">
<input type="hidden" name="messageID" value="<%= messageID %>">
<input type="hidden" name="start" value="<%= start %>">
<input type="hidden" name="range" value="<%= range %>">
<input type="submit" value=" 删除信件" >
<input type="submit" name="cancel" value=" 取消 "
onclick="location.href='main.jsp?start=<%=start%>&range=<%=range%>&time=<%=(new java.util.Date()).getTime()%>';return false;">
</form>
</div>
</td>
</tr>
</table>
</center>
</div>
</form>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table border="0" cellpadding="3" cellspacing="0" width="775">
<tr>
<td width="100%" bgcolor="#0065CE">
<%
String edition = PropertyManager.getProperty("edition");
if(edition==null)
{
edition = "Copyright ?2001 北京四通搏运软件技术有限公司 版权所有.";
}
else
{
edition = StringUtils.getChnString(edition);
}
%>
<p align="center"><font color="#FFFF00"><%=edition%></font></td>
</tr>
<tr>
<td width="100%"><img border="0" src="../images/rq11.gif" width="774" height="2"></td>
</tr>
</table>
<script language="JavaScript" type="text/javascript">
<!--
document.deleteForm.cancel.focus();
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -