📄 viewalldepartment_0002ejsp_jsp.java
字号:
import com.jspdev.ch17.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class viewAllDepartment_0002ejsp_jsp extends HttpJspBase {
// begin [file="/viewAllDepartment.jsp";from=(4,0);to=(4,76)]
// end
static {
}
public viewAllDepartment_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
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;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/viewAllDepartment.jsp";from=(0,87);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/viewAllDepartment.jsp";from=(1,58);to=(2,0)]
out.write("\r\n");
// end
// HTML // begin [file="/viewAllDepartment.jsp";from=(2,58);to=(3,0)]
out.write("\r\n");
// end
// HTML // begin [file="/viewAllDepartment.jsp";from=(3,60);to=(4,0)]
out.write("\r\n");
// end
// begin [file="/viewAllDepartment.jsp";from=(4,0);to=(4,76)]
com.jspdev.ch17.DepartmentBean bean = null;
boolean _jspx_specialbean = false;
synchronized (pageContext) {
bean= (com.jspdev.ch17.DepartmentBean)
pageContext.getAttribute("bean",PageContext.PAGE_SCOPE);
if ( bean == null ) {
_jspx_specialbean = true;
try {
bean = (com.jspdev.ch17.DepartmentBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.jspdev.ch17.DepartmentBean");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"com.jspdev.ch17.DepartmentBean", exc);
}
pageContext.setAttribute("bean", bean, PageContext.PAGE_SCOPE);
}
}
if(_jspx_specialbean == true) {
// end
// begin [file="/viewAllDepartment.jsp";from=(4,0);to=(4,76)]
}
// end
// HTML // begin [file="/viewAllDepartment.jsp";from=(4,76);to=(20,0)]
out.write("\r\n<html>\r\n<head>\r\n<title>\r\n所有部门信息\r\n</title>\r\n</head>\r\n<body>\r\n <center>\r\n <h1>所有部门信息:\r\n </h1>\r\n <table align=\"center\" bgcolor=\"#008800\" border=\"0\" cellspacing=\"2\" cellpadding=\"5\">\r\n <tr bgcolor=\"#cccccc\">\r\n <td>部门ID</td><td>姓名</td><td>领导</td><td>描述</td>\r\n </tr>\r\n\r\n");
// end
// begin [file="/viewAllDepartment.jsp";from=(20,2);to=(38,0)]
Collection temp=bean.getDepartments();
Iterator it=temp.iterator();
while(it.hasNext())
{
Department department=(Department)it.next();
out.println("<tr bgcolor=#FFFF88>");
try
{
out.println("<td>"+department.getId()+"</td>");
out.println("<td>"+department.getName()+"</td>");
out.println("<td>"+department.getLeader()+"</td>");
out.println("<td>"+department.getDescription()+"</td>");
}
catch(Exception e)
{}
out.println("</tr>");
}
// end
// HTML // begin [file="/viewAllDepartment.jsp";from=(38,2);to=(43,0)]
out.write("\r\n </table>\r\n </center>\r\n</body>\r\n</html>\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -