第一个JSP程序(JSP入门)

在web根目录新建index.jsp文件>=>Insert title here>当前系统时间> 配置web.xml===>index.jsp> 启动tomcat

浏览器显示输出

当前系统时间 2015查看jsp对应的java类文件

在D:\apache-tomcat-7.0.62\work\Catalina\localhost\ServletStudy\org\apache\jsp可以找到index_jsp.java文件,文件内容如下

/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.62 * Generated at: 2015-06-30 12:35:20 UTC * Note: The last modified time of this file was set to *the last modified time of the source file after *generation to assist with modification tracking. */package orgimport javax.servlet.*;import javax.servlet.http.*;import javax.servlet.jsp.*;public final class index_jsp extends orgimplements org{ private static final javax_jspxFactory =javax(); private static java,java.lang.Long> _jspx_dependants; private javax.el.ExpressionFactory _el_expressionfactory; private org_jsp_instancemanager; public java,java.lang.Long> getDependants() {return _jspx_dependants; } public void _jspInit() {_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();_jsp_instancemanager = org(getServletConfig()); } public void _jspDestroy() { } public void _jspService(final javaxrequest, final javaxresponse)throws java{//JSP隐含对象有以下对象final javaxpageContext;javaxsession = null;final javax.servlet.ServletContext application;final javax.servlet.ServletConfig config;javax= null;final java.lang.Object page = this;javax_jspx_out = null;javax_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 = ((((((((((new java(((“</html>”);} catch (java.lang.Throwable t) {if (!(t instanceof javax)){out = _jspx_out;if (out != null && out.getBufferSize() != 0)try {if (response.isCommitted()) {out.flush();} else {out.clearBuffer();}} catch (java.io.IOException e) {}if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);else throw new ServletException(t);}} finally {_jspxFactory.releasePageContext(_jspx_page_context);} }}总结

,世上再美的风景,都不及回家的那段路。

第一个JSP程序(JSP入门)

相关文章:

你感兴趣的文章:

标签云: