Seven JSP actions
An action can affect the output text stream and create an object by editing.
Id attribute and scope attribute attributes of each JSP action.
ID: indicates the name of an action,
Scope: indicates the scope of an action. Scope values include:
Page: javax. servlet. jsp. pagecontext
Request: The request is valid throughout the user's request by servletrequest. getattribute (name ).
Session: the session. getvalut (name) is valid throughout the user's session.
Application: servletcontext. getattribute (name) is valid during web application execution.
The following describes the seven objects:
<JSP: usebean> </jsp: usebean>:
Is the most important action in JSP. It can dynamically use the JavaBeans component to expand JSP functions.
<JSP: setproperty> </jsp: setproperty>:
It is used to assign values to attributes of a JavaBean. Note that the value of the name attribute used in this action will be the name of the JavaBean introduced by the <JSP: usebean> action.
<JSP: getproperty> </jsp: getproperty>
Used to obtain the value of a property from a JavaBean. No matter what type the original property is, it will be converted into a string type value.
<JSP: Include page = ""> </jsp: Include>: Used to introduce a static or dynamic page to a JSP file. This action can contain one or several <JSP: param> A sub-action is used to pass parameters to the page to be introduced.
<JSP: Forward page = ""> </jsp: Forward>
It is used to guide client requests to another page or another servlet. This action can contain one or several <JSP: param> sub-Actions to pass parameters to the page to be introduced.
When a <JSP: Forward> action occurs, an illegalstateexception is thrown if the text is already written to the input stream and the page is not buffered.
<JSP: Param name = "" value = ""/>: Used as a sub-action of <JSP: Include>, <JSP: Forward>, and <JSP: plugin>.
<JSP: plugin type = "applet | JavaBean"> </jsp: plugin>: rarely used, it provides a method to embed JSP files into Java programs (such as Applet and javabena) running on the client.