1. Before the servlet3.5 specification, most components of Java Web applications use the web. XML file for configuration management, servlet3.0 specifications can be configured through annotation to manage Web components, so web. XML files can become more concise, which is also a major improvement in servlet3.0.
2. jsp annotation: <% -- this is a JSP annotation -- %> (JSP annotation is not displayed on the client)
JSP Declaration: <%! Declaration Part %>
HTML comment: <! -- HTML annotation --> (HTML annotation will be displayed on the client)
3. After JSP is compiled into a Servlet File, it is stored in the work \ Catalina \ localhost \ basicsyntax \ org \ apache \ JSP folder under tomcat.
4. After the Tomcat server compiles Java into a Servlet File, it has only one instance in the Web Container, so the member variables in this instance are shared. If you access and modify member variables by one person, others will get the modified value.
5. Three JSP compilation commands
Page: this command is for the current page (for example, <% @ page import = "Java. util. String" %>
Include: Specifies to include another page (for example, <% @ include file = "Top. jsp" %>)
Taglib: used to define and access custom tags (for example, <% @ taglib prefix = "S" uri = "/Struts-tags" %>
6. Seven action commands of JSP
JSP: forward: the execution page turns to forward request processing to the next page (for example, <JSP: Forward page = ""/>)
JSP: Param: used to pass parameters. It must be used with tags of other supported parameters.
JSP: include: Used to dynamically introduce a JSP page (dynamic loading, loading only when page requests)
JSP: Plugin: used to download JavaBean or applet to the client for execution
JSP: usebean: Create a JavaBean instance
JSP: setproperty: Set the attribute value of the JavaBean instance
JSP: getproperty: outputs the attribute value of the JavaBean attribute.
7. Nine built-in objects in JSP scripts
Application: indicates the web application to which the JSP belongs.
Config: the configuration information of JSP.
Exception: exceptions and errors on other pages
Out: the output stream of the JSP page.
Page: indicates the page itself.
Pagecontext: the context of the JSP page, which is usually used to access Shared data on the page.
Request: This object encapsulates a request, which is often used for parameter transmission.
Response: indicates the server's response to the client.
Session: indicates a session.
8. servlet Development
First, you must inherit the httpservlet class and implement the init/destroy/doget/dopost methods.
After compiling the servlet, you must configure it in Web. xml. However, after servlet3.0, you can use the annotation method to configure the servlet class without configuring it in Web. xml.
9. jsp custom tag
Learn J2EE notes from scratch