📄 bulletin_add.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" errorPage="error.jsp" %><%@ include file="initialization.jsp" %><% String title=request.getParameter("title");String promulgator=request.getParameter("promulgator");String content=request.getParameter("content");String requestPage=request.getParameter("request");String thisPage=application.getRealPath(request.getRequestURI());//out.println(requestPage);//out.println(thisPage);if(requestPage!=null&&thisPage.equals(requestPage)) //如果请求页面非空{ //out.print("<script language='JavaScript'>alert('本页面请求!');</script>"); if(!title.equals("")&&!promulgator.equals("")&&!content.equals("")) { String stat="insert into bulletin(title,content,promulgateDate,promulgator)" + " values('"+title+"','"+content+"'," +"'"+dateTime.getDate()+"'"+",'"+promulgator+"');"; mysql.executeStatement(stat); } else { out.print("<script language='JavaScript'>alert('输入数据错误,请重新输入!');</script>"); }} %><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><table width="550" height="455" border="0" cellspacing="0" cellpadding="0" style="font-size:13px"> <tr> <td height="455"> <form id="form1" name="form1" method="post" action=""> <table width="550" border="0" cellspacing="0" cellpadding="0" style="font-size:13px"> <tr> <td width="69" height="27" align="right">标 题:</td> <td width="522"><input name="title" type="text" id="title" size="50" maxlength="50" /></td> </tr> <tr> <td height="25" align="right"> 发布者:</td> <td><input name="promulgator" type="text" id="promulgator" value="图书馆" maxlength="50" /> <input name="request" type="hidden" id="request" value=<%="\""+thisPage+"\""%>></td> </tr> <tr> <td height="26" colspan="2" align="center">内 容</td> </tr> <tr> <td height="57" colspan="2" align="center" valign="top"> <textarea name="content" cols="70" rows="28" id="content"></textarea> </td> </tr> <tr> <td height="27" colspan="2" align="right"><input type="submit" name="Submit" value="提交" /> <input type="reset" name="Submit2" value="重置" /> </td> </tr> </table> </form> </td> </tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -