1 JSP QuickStart 1.1 The disadvantages of the servlet
- Developers are very familiar with Java
- Does not facilitate the debugging and maintenance of the page (modify, recompile)
- It is difficult to use web design tools for Web design
- HTML content imported into the servlet
- Need to use PrintWriter object for output
1.2 JSP Introduction
- JSPs, like the servlet, are executed on the server side, but the JSP is first deployed by the server as a servlet.
- The enterprise best practice of JSP technology is to generate HTML content.
- The new JSP2.0 specification release includes new features:
- El expression
- New simple tag and tag File
- Web. XML new <jsp:config> elements
1.3 What is a JSP
- JSP is a dynamic Web technology standard, similar to other technical standards, such as ASP, PHP or ColdFusion, which is established by Sun Company and many other companies.
- Add Java program Fragments (scriptlet) and JSP tags to traditional Web page HTML files. constitutes a JSP web page. When the servlet/jsp container receives a request from the client, the program fragment is executed first, and then the execution results are responded to the client in HTML format. The program fragments can be: Operation database, redirect Web page and send e-mail, etc., these are the functions needed to build dynamic website. All program operations are performed on the server side, and only the results that are sent to the client on the network are not related to the client's browser. Because JSP is also a server-side language.
- Both Microsoft and Sun provide their respective brands of server Pages. Sun provides JSPs and Microsoft provides ASP. Both JSP and ASP are designed to enable developers to dynamically generate dynamic pages from back-end systems. Although the surface looks very similar, there are still some differences between ASP and JSP:
- JSP is platform independence, a discrimination, run anywhere.
- The developer guides the direction through JCP.
- JSP developers can expand the JSP tag library by customizing the tag.
- JavaBean and EJBS can be used with JSPs to enhance reusability and reduce code maintenance.
- JSP can access some other Java libraries, including Java database Connection (JDBC), Java Mail,java Message Service (JMS), and Jndi.
- The JSP is compiled into a binary class file that does not need to be interpreted each time it is requested.
- JSP has a wide range of support, including tools, containers, and servers.
1.4 JSP Operating principle
Cookies and session