jsp2_0002ejsp_jsp.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:4k
源码类别:
Java编程
开发平台:
Java
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class jsp2_0002ejsp_jsp extends HttpJspBase {
- private static java.util.Vector _jspx_includes;
- private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_tb_table_var_items_header;
- public jsp2_0002ejsp_jsp() {
- _jspx_tagPool_tb_table_var_items_header = new org.apache.jasper.runtime.TagHandlerPool();
- }
- public java.util.List getIncludes() {
- return _jspx_includes;
- }
- public void _jspDestroy() {
- _jspx_tagPool_tb_table_var_items_header.release();
- }
- public void _jspService(HttpServletRequest request, HttpServletResponse response)
- throws java.io.IOException, ServletException {
- JspFactory _jspxFactory = null;
- javax.servlet.jsp.PageContext pageContext = null;
- HttpSession session = null;
- ServletContext application = null;
- ServletConfig config = null;
- JspWriter out = null;
- Object page = this;
- JspWriter _jspx_out = null;
- try {
- _jspxFactory = JspFactory.getDefaultFactory();
- response.setContentType("text/html; charset=GBK");
- pageContext = _jspxFactory.getPageContext(this, request, response,
- null, true, 8192, true);
- application = pageContext.getServletContext();
- config = pageContext.getServletConfig();
- session = pageContext.getSession();
- out = pageContext.getOut();
- _jspx_out = out;
- out.write("rn");
- out.write("rn");
- out.write("<html>rn");
- out.write("<head>rn");
- out.write("<title>rnjsp2rn");
- out.write("</title>rn");
- out.write("</head>rn");
- out.write("<body bgcolor="#ffffff">rn");
- //硬编码
- //1.设置表头
- String[] header=new String[]{"name","age","code","favoriate"};
- request.setAttribute("colName",header);
- //2.设置表内容数据
- java.util.Vector v=new java.util.Vector();
- v.add("李波");
- v.add("a");
- v.add("b");
- v.add("e");
- v.add("徐蕾");
- v.add("c");
- v.add("d");
- v.add("f");
- request.setAttribute("myData",v);
- out.write("rn");
- out.write("<h1>rnJBuilder Generated JSPrn");
- out.write("</h1>rn");
- // 3.使用tag
- out.write("rn");
- if (_jspx_meth_tb_table_0(pageContext))
- return;
- out.write("rn");
- out.write("</body>rn");
- out.write("</html>rn");
- } catch (Throwable t) {
- out = _jspx_out;
- if (out != null && out.getBufferSize() != 0)
- out.clearBuffer();
- if (pageContext != null) pageContext.handlePageException(t);
- } finally {
- if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
- }
- }
- private boolean _jspx_meth_tb_table_0(javax.servlet.jsp.PageContext pageContext)
- throws Throwable {
- JspWriter out = pageContext.getOut();
- /* ---- tb:table ---- */
- tag.table _jspx_th_tb_table_0 = (tag.table) _jspx_tagPool_tb_table_var_items_header.get(tag.table.class);
- _jspx_th_tb_table_0.setPageContext(pageContext);
- _jspx_th_tb_table_0.setParent(null);
- _jspx_th_tb_table_0.setItems("myData");
- _jspx_th_tb_table_0.setHeader("colName");
- _jspx_th_tb_table_0.setVar("current");
- int _jspx_eval_tb_table_0 = _jspx_th_tb_table_0.doStartTag();
- if (_jspx_eval_tb_table_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
- do {
- out.write("rn");
- int evalDoAfterBody = _jspx_th_tb_table_0.doAfterBody();
- if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
- break;
- } while (true);
- }
- if (_jspx_th_tb_table_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
- return true;
- _jspx_tagPool_tb_table_var_items_header.reuse(_jspx_th_tb_table_0);
- return false;
- }
- }