JSP Learning -- JSP&EL(express language) studying Summary

    1. JSP

    JSP(javaServerPage)would be supplementary for Servlet, rather than be substituted. Because the JSP sloves tow problems of Servlet.Such as,first,the HTML tags in Servlet all must be enclosed by Java String,thus,make send HTTP Response become a process complicatedly;Second,all text&HTML tags must hard-compiling,so even if revise merely for Presentation Layer,we must re-compile the application.

2. JSP Concept

    As we know that, JSP is essential for Servlet,cause it is a Servlet.But using JSP is easier than Servlet,they are reasons that JSP don‘t compile and its Extension Name is jsp,could edit it use any editor.

   JSP Page also running in JSP Container. Usually, Servlet Container also is a JSP Container.eg:Tomcat is a Servlet/JSP Container.

   JSP‘s comment(注释),implicit object(隐式对象)&three grammar elements.They are directive(指令)、scripting element(脚本元素)、action(动作).

3.JSP Request Process

    Servlet/JSP Container must do two things at firstly client requires a JSP Page:

    (1)javax.servlet.jsp.JspPage Interface or its sub-interface javax.servelt.jsp.HttpjspPage to transform JSP into a JSP page implementation class.It would bo best,we could know JspPage is a sub-interface of javax.servlet.Servlet,hence,JspPage can every JSP Page become a Servlet.The Servlet  Class Name is decided on Servlet/JSP Container.

    (2)if JSP is succeedly transformed into Servlet Class,then Servlet/JSP Container would compile Servlet Class.And Container load&instace Java byte code,excute it as if treat a common Servlet to operate in a life cycle.

   

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。