📄 zy_005fpub_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import com.bean.util.DbConn;
import com.bean.util.Aca;
public final class zy_005fpub_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=gbk");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
if(session.getAttribute("user")==null||!session.getAttribute("role").toString().equals("teacher")){
response.sendRedirect("login.jsp");
return;
}
else{
}
out.write('\r');
out.write('\n');
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <base href=\"");
out.print(basePath);
out.write("\">\r\n");
out.write(" \r\n");
out.write(" <title>My JSP 'zy_pub.jsp' starting page</title>\r\n");
out.write(" \r\n");
out.write("\t<meta http-equiv=\"pragma\" content=\"no-cache\">\r\n");
out.write("\t<meta http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
out.write("\t<meta http-equiv=\"expires\" content=\"0\"> \r\n");
out.write("\t<meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\">\r\n");
out.write("\t<meta http-equiv=\"description\" content=\"This is my page\">\r\n");
out.write("\r\n");
out.write(" </head>\r\n");
out.write(" <script language=\"JavaScript\" src=\"js/pub_calendar.js\"> \r\n");
out.write(" </script> \r\n");
out.write(" <script type=\"text/javascript\">\r\n");
out.write(" function check()\r\n");
out.write(" {\r\n");
out.write("\tvar zy_name=document.all.hmmc.value;\r\n");
out.write("\tif(zy_name==\"\")\r\n");
out.write(" \t{\r\n");
out.write(" \t\talert(\"请输入你的作业名称\");\r\n");
out.write(" \t\treturn false;\r\n");
out.write(" \t}\r\n");
out.write("\t var tmpDateValue = document.all.end_date.value; \r\n");
out.write(" var tmpLength = tmpDateValue.length; \r\n");
out.write(" if (tmpLength == 0){ \r\n");
out.write(" \t\talert(\"请输入截止日期!\"); \r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" for (var i = 0; i < tmpLength;i++){ \r\n");
out.write(" aChar = tmpDateValue.substring(i,i+1); \r\n");
out.write(" if(aChar != \"-\" && (aChar < \"0\" || aChar > \"9\")) { \r\n");
out.write(" alert (\"请按照格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write(" \t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" } \r\n");
out.write(" if ((tmpLength < 8 || tmpLength > 10) && tmpLength != 0) { \r\n");
out.write(" alert (\"请按照格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write("\t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" for (var j= 0; j < 4;j++){ \r\n");
out.write(" aChar = tmpDateValue.substring(j,j+1); \r\n");
out.write(" if(aChar < \"0\" || aChar > \"9\") { \r\n");
out.write(" alert (\"请按照格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write("\t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" } \r\n");
out.write(" if (tmpDateValue.substring(4,5) != \"-\" || tmpDateValue.substring(5,6) == \"-\"){ \r\n");
out.write(" alert (\"请按规定格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write("\t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" if (tmpLength == 8){ \r\n");
out.write(" if (tmpDateValue.substring(6,7) != \"-\" || tmpDateValue.substring(7,8) == \"-\" ){ \r\n");
out.write(" alert (\"请按规定格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write("\t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" } \r\n");
out.write(" if (tmpLength == 9){ \r\n");
out.write(" if (tmpDateValue.substring(8,9) == \"-\" ){ \r\n");
out.write(" alert (\"请按规定格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write("\t\t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
out.write(" } \r\n");
out.write(" } \r\n");
out.write(" if (tmpLength == 10){ \r\n");
out.write(" if (tmpDateValue.substring(7,8) != \"-\" || tmpDateValue.substring(6,7) == \"-\" || tmpDateValue.substring(8,9) == \"-\" || tmpDateValue.substring(9,10) == \"-\" ){ \r\n");
out.write(" alert (\"请按规定格式输入日期(yyyy-mm-dd)。\"); \r\n");
out.write("\t\t\t\tdocument.all.end_date.value=\"\";\r\n");
out.write(" return false; \r\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -