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

📄 softlist_jsp.java

📁 vb+java实现的图书管理系统
💻 JAVA
字号:
package org.apache.jsp.svc;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import model.svc.hibernate.dao.entity.ThCourse;
import model.svc.hibernate.dao.crud.ThCourseDAO;;

public final class softList_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=UTF-8");
      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\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

      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 'softList.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("\t<!--\r\n");
      out.write("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">\r\n");
      out.write("\t-->\r\n");
      out.write("\r\n");
      out.write("  </head>\r\n");
      out.write("  <script type=\"text/javascript\" charset=\"utf-8\">\r\n");
      out.write("\t\tfunction getResult(stateVal) {\r\n");
      out.write("\t\t\tif(stateVal==\"\"){\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\telse{\r\n");
      out.write("\t\t\t\tvar url = \"");
      out.print(basePath);
      out.write("GetSoftInfo?th_cour_id=\"+stateVal;\r\n");
      out.write("\t\t\t\tif (window.XMLHttpRequest) {\r\n");
      out.write("\t\t\t\t\treq = new XMLHttpRequest();\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t\telse if (window.ActiveXObject) {\r\n");
      out.write("\t\t\t\t\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t\tif(req){\r\n");
      out.write("\t\t\t\t\treq.open(\"GET\",url, true);\r\n");
      out.write("\t\t\t\t\treq.onreadystatechange = softInfo;\r\n");
      out.write("\t\t\t\t\treq.send(null);\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\tfunction softInfo()\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t\tif (req.readyState == 4) {\r\n");
      out.write("\t\t\t\tif (req.status == 200) {\r\n");
      out.write("\t\t\t\t\tvar strhtml=\"\";\r\n");
      out.write("\t\t\t\t\tvar softId=req.responseXML.getElementsByTagName(\"softId\");\r\n");
      out.write("\t\t\t\t\tvar softName=req.responseXML.getElementsByTagName(\"softName\");\r\n");
      out.write("\t\t\t\t\tvar groupName=req.responseXML.getElementsByTagName(\"groupName\");\r\n");
      out.write("\t\t\t\t\tstrhtml+=\"<table style='left-padding:20px;'>\";\r\n");
      out.write("\t\t\t\t\tif(softId.length==0||softId==null){}\r\n");
      out.write("\t\t\t\t\telse{\r\n");
      out.write("\t\t\t\t\t\tstrhtml+=\"<tr><td style='width:200px'>软件名称</td><td style='width:100px'>小组名称</td><td style='width:100px'></td><td></td></tr>\";\r\n");
      out.write("\t\t\t\t\t\tfor(var i=0;i<softId.length;i++){\r\n");
      out.write("\t\t\t\t\t\t\t\tstrhtml+=\"<tr><td style='width:200px'><a href='");
      out.print(basePath);
      out.write("svc/softVerDisplay.jsp?softId=\"+softId[i].firstChild.data+\"'>\"+softName[i].firstChild.data+\"</td><td style='width:100px'>\"+groupName[i].firstChild.data+\"</td><td><a href='");
      out.print(basePath);
      out.write("teacher.jsp?contr=softVersionInfo&softId=\"+softId[i].firstChild.data+\"'>查看详细</a></td><td><a href='");
      out.print(basePath);
      out.write("teacher.jsp?contr=softMark&softId=\"+softId[i].firstChild.data+\"'>评分</a></td></tr>\";\r\n");
      out.write("\t\t\t\t\t\t}\r\n");
      out.write("\t\t\t\t\t}\r\n");
      out.write("\t\t\t\t\tstrhtml+=\"</table>\";\r\n");
      out.write("\t\t\t\t\t//alert(strhtml);\r\n");
      out.write("\t\t\t\t\tdocument.all.softInfoList.innerHTML=strhtml;\r\n");
      out.write("\t\t\t\t}\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\t\r\n");
      out.write("\t</script>\r\n");
      out.write("  <body>\r\n");
      out.write("  \t\t<h2>小组作业列表</h2>\r\n");
      out.write("\t \t<div class=\"articles\">\r\n");
      out.write("  \t\t");
  ThCourseDAO thCourseDAO=new ThCourseDAO();
	  		String th_id=session.getAttribute("user").toString();
	  		String hql="from ThCourse thCourse join fetch thCourse.courses where thCourse.teachers.thId='"+th_id+"'";
	  		List courses=thCourseDAO.findByHQL(hql);
	  		if(courses==null){
	  	
      out.write("\r\n");
      out.write("\t  \t\t\t您暂无授课记录!\r\n");
      out.write("\t  \t");
		
	  		}
	  		else
	  		{
	  	
      out.write("\r\n");
      out.write("\t\t  \t<ul style=\"list-style:none\">\r\n");
      out.write("\t\t\t\t<li>课程名称:<select name=\"th_cour_id\" style=\"width:200px\" onChange=\"getResult(this.value)\">\r\n");
      out.write("\t\t\t\t<option value=\"\">请选择课程</option>\r\n");
      out.write("\t\t\t\t");
for(int i=0;i<courses.size();i++){
					ThCourse thCourse=(ThCourse)courses.get(i);
					out.println("<option value="+thCourse.getThCourseId()+">"+thCourse.getCourses().getCourName()+"</option>");
				} 
      out.write("\r\n");
      out.write("\t\t\t\t</select>\r\n");
      out.write("\t\t\t\t</li><br><br>\r\n");
      out.write("\t\t\t\t<li><div id=softInfoList></div></li>\r\n");
      out.write("\t\t\t</ul>\r\n");
      out.write("\t\t\t");
} 
      out.write("\r\n");
      out.write("\t\t</div>\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)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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