📄 classstuinfo_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import sms.db.*;
import sms.bean.*;
import java.util.*;
public final class classStuInfo_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
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 {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"errorPage.jsp", 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\n");
out.write("\r\n");
request.setCharacterEncoding("gb2312");
String commitFlag = request.getParameter("queryButton");
ArrayList aList = null;
String classId= null;
if (commitFlag != null ) {
StudentBean stuBean = new StudentBean();
classId = request.getParameter("classId");
if (classId == null || classId.equals("")) {
out.write("\r\n");
out.write("<script language=\"javascript\" type=\"\">\r\n");
out.write(" alert('请输入班级编号!');\r\n");
out.write(" </script>\r\n");
} else {
aList = stuBean.queryClassStudents(classId);
if(aList == null || aList.size() <= 0){
out.write("\r\n");
out.write("<script language=\"javascript\" type=\"\">\r\n");
out.write(" alert('没有该班级学生信息!');\r\n");
out.write(" </script>\r\n");
}
}
}
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<title>班级学生信息查询</title>\r\n");
out.write("<link href=\"css/style.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
out.write("<style type=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write("body {\r\n");
out.write("\tbackground-color: #CCCCCC;\r\n");
out.write("}\r\n");
out.write("-->\r\n");
out.write("</style></head>\r\n");
out.write("<body>\r\n");
out.write("<table width=\"100%\" border=\"0\" align=\"center\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"32\">查询班级学生信息</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"44\" bgcolor=\"#999999\">\r\n");
out.write(" <form name=\"form1\" method=\"post\" action=\"\">\r\n");
out.write(" <input type=\"hidden\" name=\"commitFlag\" value=\"submit\">\r\n");
out.write(" <table width=\"100%\" border=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"26%\" height=\"25\" align=\"right\">要查询的班级号:</td>\r\n");
out.write(" <td width=\"32%\">\r\n");
out.write(" <input name=\"classId\" type=\"text\" value=\"");
out.print(classId==null?"":classId);
out.write("\" class=\"text1\">\r\n");
out.write(" </td>\r\n");
out.write(" <td width=\"22%\">\r\n");
out.write(" <input name=\"queryButton\" type=\"submit\" class=\"button1\" value=\"提交\">\r\n");
out.write(" </td>\r\n");
out.write(" <td width=\"20%\"> </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" </form>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"346\" align=\"center\" valign=\"top\">\r\n");
out.write(" <table width=\"100%\" border=\"1\" bordercolorlight= #C1A4F4 borderColorDark=#ffffff cellPadding=0 cellSpacing=0>\r\n");
out.write(" <tr>\r\n");
out.write(" <th width=\"16%\" scope=\"col\" height=\"23\">学号</th>\r\n");
out.write(" <th width=\"20%\" scope=\"col\">姓名</th>\r\n");
out.write(" <th width=\"17%\" scope=\"col\">性别</th>\r\n");
out.write(" <th width=\"18%\" scope=\"col\">籍贯</th>\r\n");
out.write(" <th width=\"15%\" scope=\"col\">学院</th>\r\n");
out.write(" <th width=\"14%\" scope=\"col\">年龄</th>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
if (aList != null && aList.size() > 0) {
StudentBean stuBean2 = new StudentBean();
for (int i = 0; i < aList.size(); i++) {
stuBean2 = (StudentBean) aList.get(i);
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"center\">");
out.print(stuBean2.getStudentId());
out.write(" </td>\r\n");
out.write(" <td align=\"center\">");
out.print(stuBean2.getName());
out.write(" </td>\r\n");
out.write(" <td align=\"center\">");
out.print(stuBean2.getSex().equals("1")?"男":"女");
out.write(" </td>\r\n");
out.write(" <td align=\"center\">");
out.print(stuBean2.getComeFrom());
out.write(" </td>\r\n");
out.write(" <td align=\"center\">");
out.print(stuBean2.getCollegeName());
out.write(" </td>\r\n");
out.write(" <td align=\"center\">");
out.print(stuBean2.getAge());
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
}
}
out.write("\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"18\"> </td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -