java servlet and jsp cookbook 第一章 读后总结

1:为什么servlet抛出 ServletException,IOException

(1): if the servlet detected a security violation or some other request problem ,the servlet throw ServletException

(2):The servlet throws IOException because the response.getWriter( ) (as well as PrintWriter.close( )) method call can throw an IOException

2:如何立即编译jsp文件?(可解决服务缓存问题)

在jsp文件后加上jsp_precompile=true参数即可

oreilly源话:

You can avoid delays by precompiling the JSP. If you request the JSP with a jsp_precompile=true parameter, Tomcat converts the JSP, but does not send back a response. An example is http://localhost:8080/home/firstJ.jsp?jsp_precompile=true.

你可能感兴趣的:(servlet)