How JSP work.
A JSP page exists in three forms:
- JSP source code:
- consists of a mix of HTML template code.
- Java language statements.
- JSP directives and actions that describe how to generate a Web page to service a particular request.
- Java source code.
- Compiled Java class.
Figure 5-1 illustrates the process used by the JSP container.
When a request for a JSP page is made, the container first determines the name of the class corresponding to the .jsp file.
If the class doesn’t exist or if it’s older than the.jsp file (meaning the JSP source has changed since it was last compiled),
then the container creates Java source code for an equivalent servlet and compiles it.
If an instance of the servlet isn’t already running,
the container loads the servlet class and creates an instance.
Finally, the container dispatches a thread to handle the current HTTP request in the loaded instance.
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。