1、 外文原文 Jsp.A Packaging JSP Pages This appendix shows two simple examples of packaging a JSP page into a WAR fro deliver into a Web container.In the first example, theJSP page is deliverd in source form. This is likely to be the most common example.In the second example the JSP page is complied into a
2、 servlet that uses only Servlet 2.4 and JSP2.0 API call;the Servlet is then packaged into a WAR with a deployment descriptor such that it looks as the original JSP page to any client. This appendix is non normative. Actually, strictly speaking,the appendix relates more to the Servlet 2.4 capabilitie
3、s than to the JSP 2.0 capabilities.The appendix is included here as this is a feature that JSP page authors and JSP page authoring tools are interested in. JSP.A.1A Very Simple JSP page We start with a very simple JSP page helloWorld.jsp JSP.A.2 The JSP Page Packaged as Source in a WAR File The JSP
4、page can be packaged into a WAR file by just placing it at location/HelloWorld.jsp the default JSP pate extensiong mapping will pick it up.The web.xml is trivial: JavaServer Pages 2.0 Specification JSP.A.3 The Servlet for the Compiled JSP Page As an alternative, we will show how one can compile the JSP page into a servlet class to run in a JSP container. The JSP page is compiled into a servlet with some implementation dependent name com.acme_jsp_HelloWorld_*_Impl.The servlet code only depends