Jsp standard action, jsp Standard

Source: Internet
Author: User

Jsp standard action, jsp Standard

The format of JSP standard action elements is: <jsp: Tag Name>, which is expressed in strict xml tag syntax. these jsp tag action elements are executed in the user request phase. These standard action elements are embedded in the jsp file, so they can be directly used without reference and definition.

Standard action elements include:

<Jsp: useBean>: defines that the jsp page uses a JavaBean instance;

<Jsp: setProperty>: Set the attribute value in a JavaBean;

<Jsp: getProperty>: Get a property value from the JavaBean;

<Jsp: include>: contains an external file on the JSP page;

<Jsp: forward>: forwards incoming requests to another page for processing;

<Jsp: param>: used to pass parameter values;

<Jsp: plugin>: used to specify the attributes of the plug-in inserted in the client browser;

<Jsp: params>: used to pass parameter values to the HTML page plug-in;

<Jsp: fallback>: Specifies how to handle cases where the client does not support plug-ins;

 

Introduction to JSP standard actions

When the jsp page is translated into Servlet Source Code, when the container encounters a standard action element, it calls the corresponding Servlet class method to replace it, all standard action elements are marked with a JSP prefix. The general format is as follows:

<Jsp: Tag name... Attribute... />

Some standard actions also include an individual, that is, a standard action element contains other standard action elements or other content, including the format of the standard action of the body:

<Jsp: Tag name... Properties...>

<Jsp: Tag name... Attributes and parameters... />

</Jsp: Tag Name>

 

Based on the functions of each standard action, you can divide these standard actions into the following six groups:

1. the standard action to Use JavaBean in jsp: <jsp: useBean> defines a JaveBean instance, and the ID attribute defines the Instance name. <jsp: getProperty> obtains an attribute value from a JavaBean, and add it to the response; <jsp: setProperty> sets the attribute value in a JavaBean;

2. standard action to include other jsp files or web Resources in jsp: <jsp: include> the response from a Servlet or jsp file is included in the request processing stage. Note that it is different from the include command;

3. forward the received request to another jsp page or web resource for further operations. Standard action: <jsp: forward> forward the processing of a request to another Servlet or jsp page;

4. specify the standard action of the parameter in the middle of other standard actions: <jsp: param> for the use of <jsp: include> or <jsp: forward> Add a pass parameter value for the request passed to another Servlet or jsp page;

5. embed a java object (for example, an applet, a small java program running on the client) on the page of the Client: <jsp: plugin> set the browser type to java

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.