⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.jsp

📁 BBS-CS 天乙社区 是采用JSP+JavaBean+Servlet、Struts的MVC框架开发的一套网络虚拟社区系统。文件解压缩后有详细文件说明。
💻 JSP
字号:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page import="com.laoer.bbscs.sysinfo.*"%>
<%@ page import="com.laoer.bbscs.bbs.business.*"%>
<%@ page import="com.laoer.bbscs.servlet.*"%>
<%@ page import="com.laoer.bbscs.util.*"%>
<%@ page import="java.util.*"%>
<%
String sid = (String)request.getAttribute("sid");
UserSessionCheck myUserSessionCheck = (UserSessionCheck)request.getAttribute("myUserSessionCheck");
String headadv = (String)request.getAttribute("headadv");
String bid = (String)request.getAttribute("bid");
String useedit = (String)request.getAttribute("useedit");
String action = (String)request.getAttribute("action");
BoardsInfo theBoards = (BoardsInfo)request.getAttribute("theBoards");
String boardsname = "";
String eboardsname = "";
boardsname = theBoards.getBoardsName();
eboardsname = theBoards.getBoardsEName();

String mainid = "";
String recid = "";
String pages = "";
String totalnum = "";
String title = "";
if (action.equals("re")) {
mainid = (String)request.getAttribute("mainid");
recid = (String)request.getAttribute("recid");
pages = (String)request.getAttribute("pages");
totalnum = (String)request.getAttribute("totalnum");
title = (String)request.getAttribute("title");
if (!title.startsWith("Re:")) {
    title = "Re:"+title;
}
}

 String htmledit = "";
 if (useedit.equals("no")) {
   if (action.equals("re")) {
     htmledit =Sys.getURL() +"postAction.do?sid="+sid+"&bid="+bid+"&action=re&recid="+recid+"&mainid="+mainid+"&pages="+pages+"&totalnum="+totalnum+"&useedit=yes";
   }
   else {
     htmledit =Sys.getURL() +"postAction.do?sid="+sid+"&bid="+bid+"&action=new&useedit=yes";
   }
 }
 else {
   if (action.equals("re")) {
     htmledit = Sys.getURL() +"postAction.do?sid="+sid+"&bid="+bid+"&action=re&recid="+recid+"&mainid="+mainid+"&pages="+pages+"&totalnum="+totalnum+"&useedit=no";
   }
   else {
     htmledit = Sys.getURL() +"postAction.do?sid="+sid+"&bid="+bid+"&action=new&useedit=no";
   }
 }
%>
<html:html locale="true">
<HEAD><TITLE><bean:message key="post.title"/></TITLE>
<link rel=stylesheet type="text/css" href="css/<%=myUserSessionCheck.getUser().getUserInfo().getStyle()%>/css2.css">
<%//=Sys.getCSS(myUserSessionCheck.getUser().getUserInfo().getStyle(),2)%>
<script language=javascript>
<!--
clckcnt = 0;
function bs(){
var f=document.postActionForm
<%
if (useedit.equals("yes")) {
out.print("f.detail.value=f.HTML.value;");
}
%>
if(f.title.value.length==0){alert("<bean:message key="error.post.notitle"/>");f.title.focus();return false}
if(f.detail.value.length==0){alert("<bean:message key="error.post.nodetail"/>");return false}
clckcnt++;
if(clckcnt > 1) {
  if(clckcnt > 2)
    { return false; }
  alert('内容已经发出了......\n\n' + '请等待片刻......\n\n' + '不要重复按提交键,谢谢!');
  return false;
}
document.postActionForm.submit();
}
function br(){
if(!confirm("<bean:message key="post.doyoureset"/>")){return false;}
document.postActionForm.title.select()
}
//-->
</script>
</HEAD>
<BODY topMargin=0 marginheight="0">
<%=headadv%>
<form name="postActionForm" method="post" action="<%=Sys.getURL()%>postAction.do" enctype="multipart/form-data" onreset="return br()">
<INPUT TYPE="hidden" name="bid" value="<%=bid%>">
<input TYPE="hidden" NAME="useedit" VALUE="<%=useedit%>">
<INPUT name="sid" type=hidden value="<%=sid%>">
<%if (action.equals("re")) {%>
<input TYPE="hidden" NAME="action" VALUE="repost">
<input TYPE="hidden" NAME="mainid" VALUE="<%=mainid%>">
<input TYPE="hidden" NAME="recid" VALUE="<%=recid%>">
<input TYPE="hidden" NAME="pages" VALUE="<%=pages%>">
<input TYPE="hidden" NAME="totalnum" VALUE="<%=totalnum%>">
<%} else {%>
<input TYPE="hidden" NAME="action" VALUE="add">
<%}%>
  <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1">
    <tr>
      <td width="20%" class='T1' height="23">&nbsp;</td>
      <td width="78%" class='T1' height="23"><font color=#ffffff><bean:message key="post.youatboards" arg0="<%=boardsname%>" arg1="<%=eboardsname%>"/>
<%
if (useedit.equals("no")) {
%>
<bean:message key="post.cannotpost" arg0="<%=htmledit%>" />
<%
}
else {
%>
<bean:message key="post.cannotpost1" arg0="<%=htmledit%>" />
<%
}
%>
</font></td>
    </tr>
    <tr>
      <td width="20%" class='T2'><bean:message key="post.topic"/></td>
      <td width="78%" class='T2'>
        <input type="text" name="title" size="50" maxlength="60" value="<%if (title != null) {out.print(Util.stripslashes(title));}%>">
      </td>
    </tr>
    <tr>
      <td width="20%" class='T2'><bean:message key="post.face"/></td>
      <td width="78%" class='T2'>
<TABLE cellSpacing=2 cellPadding=2 border=0>
        <TBODY>
        <TR>
          <TD><INPUT type=radio CHECKED value=1 name=bq></TD>
          <TD><IMG src="images/1.gif"></TD>
          <TD><INPUT type=radio value=2 name=bq></TD>
          <TD><IMG src="images/2.gif"></TD>
          <TD><INPUT type=radio value=3 name=bq></TD>
          <TD><IMG src="images/3.gif"></TD>
          <TD><INPUT type=radio value=4 name=bq></TD>
          <TD><IMG src="images/4.gif"></TD>
          <TD><INPUT type=radio value=5 name=bq></TD>
          <TD><IMG src="images/5.gif"></TD>
          <TD><INPUT type=radio value=6 name=bq></TD>
          <TD><IMG src="images/6.gif"></TD>
          <TD><INPUT type=radio value=13 name=bq></TD>
          <TD><IMG src="images/13.gif"></TD>
          <TD><INPUT type=radio value=14 name=bq></TD>
          <TD><IMG src="images/14.gif"></TD>
          <TD><INPUT type=radio value=15 name=bq></TD>
          <TD><IMG src="images/15.gif"></TD>
          <TD><INPUT type=radio value=16 name=bq></TD>
          <TD><IMG src="images/16.gif"></TD></TR>
        <TR>
          <TD><INPUT type=radio value=7 name=bq></TD>
          <TD><IMG src="images/7.gif"></TD>
          <TD><INPUT type=radio value=8 name=bq></TD>
          <TD><IMG src="images/8.gif"></TD>
          <TD><INPUT type=radio value=9 name=bq></TD>
          <TD><IMG src="images/9.gif"></TD>
          <TD><INPUT type=radio value=10 name=bq></TD>
          <TD><IMG src="images/10.gif"></TD>
          <TD><INPUT type=radio value=11 name=bq></TD>
          <TD><IMG src="images/11.gif"></TD>
          <TD><INPUT type=radio value=12 name=bq></TD>
          <TD><IMG src="images/12.gif"></TD>
          <TD><INPUT type=radio value=17 name=bq></TD>
          <TD><IMG src="images/17.gif"></TD>
          <TD><INPUT type=radio value=18 name=bq></TD>
          <TD><IMG src="images/18.gif"></TD>
          <TD><INPUT type=radio value=19 name=bq></TD>
          <TD><IMG src="images/19.gif"></TD>
          <TD><INPUT type=radio value=20 name=bq></TD>
          <TD><IMG src="images/20.gif"></TD></TR>
	 </TBODY>
</TABLE>
      </td>
    </tr>
    <tr>
      <td width="20%" class='T2'><bean:message key="post.detail"/></td>
      <td width="78%" class='T2'>
      <%
      if (useedit.equals("no")) {
      %>
        <textarea name="detail" cols="70" rows="15"></textarea>
      <%
      }
      else {
      %>
        <OBJECT id=HTML data="edit/editor.html" width="100%" height=360 type=text/x-scriptlet></object><textarea style="DISPLAY:none" name="detail"></textarea>
      <%
      }
      %>
      </td>
    </tr>
    <tr>
      <td width="20%" class='T2'><bean:message key="post.sign"/></td>
      <td width="78%" class='T2'>
      <%=myUserSessionCheck.getUser().getUserInfo().getHtmlSign()%>
      <input type="radio" name="sign" value="0" checked>
        <bean:message key="post.nosign"/></td>
    </tr>
    <tr>
      <td width="20%" class='T2'><bean:message key="post.renotice"/></td>
      <td width="78%" class='T2'>
        <input type="checkbox" name="email_inform" value="1">
        <bean:message key="post.emilre"/>
        <input type="checkbox" name="msg_inform" value="1">
        <bean:message key="post.msgre"/></td>
    </tr>
    <%
    if (Sys.SYSINFO.UPIMG.equals("yes")) {
    %>
    <tr>
      <td width="20%" class='T2'><bean:message key="post.upimg"/></td>
      <td width="78%" class='T2'>
      <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="102400">
      <INPUT name="form_data" type=file> <bean:message key="post.upnotice" arg0="<%=String.valueOf(Sys.SYSINFO.UPIMGSIZE)%>" />
      </td>
    </tr>
    <%
    }
    %>
    <tr>
      <td width="20%" class='T1' height="22">&nbsp;</td>
      <td width="78%" class='T1' height="22"><font class=p9 color=#ffffff><bean:message key="post.postnotice"/></font></td>
    </tr>
    <tr>
      <td colspan="2">
        <div align="center">
        <input type="button" name="ok" value="<bean:message key="bbscs.botton.submit"/>" onclick="bs();">
        <input type="reset" name="Submit2" value="<bean:message key="bbscs.botton.reset"/>">
        <input type="button" name="back" value="<bean:message key="bbscs.goback"/>" onclick="javascript:history.back()">
        </div>
      </td>
    </tr>
  </table>
</form>
<%
sid = null;
myUserSessionCheck = null;
headadv = null;
bid = null;
useedit = null;
action = null;
theBoards = null;
boardsname = null;
eboardsname = null;
mainid = null;
recid = null;
pages = null;
totalnum = null;
title = null;
htmledit = null;
%>
</BODY>
</html:html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -