JSP tag
JSP tags are also called Jsp Action elements. They are used to provide business logic functions on JSP pages, avoiding the difficulty of maintaining Jsp pages by writing java code directly on JSP pages.
Common JSP labels
<Jsp: include> tag
<Jsp: include> the tag is used to insert the output content of another resource into the output content of the current JSP page. This introduction method during JSP page execution is called dynamic introduction.
Syntax: <jsp: include page = "relativeURL | <% = expression %>" flush = "true | false"/>
The page attribute is used to specify the relative path of the introduced resource. It can also be obtained by executing an expression.
The flush attribute specifies whether to refresh the output content of the current JSP page to the client before inserting the output content of other resources.
<Jsp: forward> tag
<Jsp: forward> the tag is used to forward requests to another resource.
Syntax: <jsp: forward page = "relativeURL | <% = expression %>"/>
The page attribute is used to specify the relative path of the resource to which the request is forwarded. It can also be obtained by executing an expression.
<Jsp: param> label
When you use the <jsp: include> and <jsp: forward> labels to introduce or forward requests to other resources, you can use the <jsp: param> label to pass parameters to this resource.
Syntax 1: <jsp: include page = "relativeURL | <% = expression %>">
<Jsp: param name = "parameterName" value = "parameterValue | <% = expression %>"/>
</Jsp: include>
Syntax 2: <jsp: forward page = "relativeURL | <% = expression %>">
<Jsp: param name = "parameterName" value = "parameterValue | <% = expression %>"/>
</Jsp: include>
<Jsp: param> the name attribute of the tag is used to specify the parameter name, and the value attribute is used to specify the parameter value. You can use multiple <jsp: param> tags in the <jsp: include> and <jsp: forward> tags to pass multiple parameters.
<Jsp: include> comparison with include commands
<Jsp: include> tags are dynamically introduced. The two jsp pages involved in the <JSP: include> tag are translated into two servlets, the contents of the two servlets are merged during execution.
The include command is a static introduction. The two JSP pages involved are translated into a servlet, whose content is merged at the source file level.
Whether it is the <jsp: include> label or the include command, they will combine the content of the two JSP pages and output them. Therefore, do not duplicate the HTML global architecture labels on these two pages, otherwise, the content output to the client will be a messy HTML document.
Four domain objects for web Development
Page domain (pageContext) cycle: Current page
It is called the request domain (request) cycle: the request ends.
It is called the session domain (session) cycle: the session ends.
Called the application domain (servletContext) cycle: the entire web application
From chenglong0513