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

📄 article.jsp

📁 用于BBS交流的网站
💻 JSP
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
String type;
String isTopic;
String pid;
String rootid;
String leaf;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<% 
//判断是发帖还是回帖
type = request.getParameter("type");
pid = request.getParameter("id");//上一个帖子的id作为下一个帖子的pid
rootid = request.getParameter("rootid");
leaf = request.getParameter("leaf");
if (null == type) {
	response.sendRedirect("showErrorInfo.jsp");
} else if ("topic".equals(type)) {
	isTopic = "true";
} else {
	isTopic = "false";
}
%>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'dealArticle.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
    	function check() {
    		if ("" ==document.all.title.value) {
    			alert("题目不能为空");
    			return false;
    		}
    		if ("" ==document.all.content.value) {
    			alert("内容不能为空");
    			return false;
    		}
    		return true;
    	}
    </script>
  </head>
  
  <body>
  <table width="800" height="238" border="0" align="center" cellpadding="2" cellspacing="2">
    <tr>
      <td height="234"><form name="form1" method="post" action="forum/dealArticle.jsp" onsubmit="return check()">
      <input type="hidden" name="isTopic" value="<%=isTopic %>">
      <input type="hidden" name="pid" value="<%=pid %>">
      <input type="hidden" name="rootid" value="<%=rootid %>">
      <input type="hidden" name="leaf" value="<%=leaf %>">
        <table width="800" height="199" border="0" cellpadding="2" cellspacing="2">
          <tr>
            <td height="27">主题:
            <input name="title" type="text" maxlength="50"></td>
          </tr>
          <tr>
            <td height="25">内容:</td>
          </tr>
          <tr>
            <td><textarea name="content" cols="50" rows="10"></textarea></td>
          </tr>
          <tr>
            <td height="27"><input name="submit" type="submit" id="submit" value="提交">
            <input name="reset" type="reset" id="reset" value="重置"></td>
          </tr>
        </table>
            </form>
      </td>
    </tr>
  </table>
  </body>
</html>

⌨️ 快捷键说明

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