Seven JSP actions

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.