The JSP will be converted to servlet when running JSP (long time, and there will be a lot)
Configured applications can be installed by setting up the URI mapping of the JSP page, then only install the compiled Java class file to implement the installation (you can pack the servlet class file to avoid the change of the JSP file)
Precamment method:
Run the JSP page that needs to be compiled in the development environment: Tomcat defaults to save the JSP page class file in the work directory
Use the jsp_precompile parameter: only compile the page without processing the request: such as applet.jsp? Jsp_precompile or applet.jsp? Jsp_precompile = TRUE
Tomcat's pre-compilation: Is the JSP container named the class files complicated? ? ? (This book is based on JSP1.1)
★ from
Tomcat's release, from 4.x Start Tomcat's compiler has been rewritten, and enhance the management of applications developed using integrated development tools, the problem of class file names in Tomcat5.0.28 I have been got Good solution
Let the app call the servlet class file directly: Transfer the class file to the subdirectory matching the package name -> Add this JSP page URI mapping rule to the web-inf / web.xml file in
★ Note: You cannot use another container to deploy the servlet generated in other containers (Web container calls your own internal class in the servlet thereof)
JSP page Cache: Set the first part of the following method to inform the browser and proxy server not to cache the page
Response.addheader ()
Response.adddateHeader ()
Or turn the scripts described above into custom behavior (more simple)
Interpretation of the URL: Terminology used to describe URIs in HTTP, Servlet and JSP specification
1. Absolute URI: The URI used by the HTML element generated by the JSP page is interpreted by the browser; the needs of the browser
The following two are explained by a web container:
2. Absolute path URI: Start with "/": Resources on the same server; the container will explain according to the application's environmental path (Context path)
3. Relative path URI: Not "/": the path where the current page is located: "Process.jsp" or "../Image/xxx.gif"