JSP action commands

Source: Internet
Author: User

In jsp (preferred for SUN Enterprise applications)Action instructionIncluding:Include,Forward,UseBean,GetProperty,SetProperty,Plugin.

I,Include command

<Jsp (preferred for SUN Enterprise Applications): include> tagContains a static or dynamic file.

Syntax:
<Jsp (preferred for SUN Enterprise Applications): include page = "path" flush = "true"/>
Or
<Jsp (preferred for SUN Enterprise Applications): include page = "path" flush = "true">
<Jsp (preferred for SUN Enterprise Applications): param name = "paramName" value = "paramValue"/>
</Jsp (preferred for SUN Enterprise Applications): include>

Note:
1. page = "path" is a relative path or a relative path expression.
2. flush = "true" must be set to true. The default value is false.
3. <jsp (preferred for SUN Enterprise Applications): The param> clause allows you to pass one or more parameters to dynamic files, you can also use multiple <jsp (preferred for SUN Enterprise Applications): param> on a single page to pass multiple parameters to dynamic files.

II,Forward Command

<Jsp (preferred for SUN Enterprise Applications): forward> tagRedirects a static html/jsp file (preferred for SUN Enterprise Applications) or a program segment.

Syntax:
<Jsp (preferred for SUN Enterprise Applications): forward page = "path"}/>
Or
<Jsp (preferred for SUN Enterprise Applications): forward page = "path"}>
<Jsp (preferred for SUN Enterprise Applications): param name = "paramName" value = "paramValue"/> ......
</Jsp (preferred for SUN Enterprise Applications): forward>

Note:
1. page = "path" is an expression or a string.
2. <jsp (preferred for SUN Enterprise Applications): param> name specifies the parameter name and value specifies the parameter value. The parameter is sent to a dynamic file. The parameter can be one or more values, but the file must be a dynamic file. To pass multiple parameters, you can use multiple <jsp (preferred for SUN Enterprise Applications) files in one jsp (preferred for SUN Enterprise Applications ): param> sends multiple parameters to a dynamic file.

III,UseBean command

<Jsp (preferred for SUN Enterprise Applications): useBean> tagIt is used to create a BEAN instance on the jsp (preferred for SUN Enterprise Applications) page and specify its name and scope.

Syntax:
<Jsp (preferred for SUN Enterprise Applications): useBean id = "name" scope = "page | request | session | application" typeSpec/>
TypeSpec has the following possibilities:
Class = "className" | class = "className" type = "typeName" | beanName = "beanName" type = "typeName" | type = "typeName" |

Note:
You must use class or type instead of both class and beanName. BeanName indicates the Bean name in the form of "a. B. c ".

IV,GetProperty command

<Jsp (preferred for SUN Enterprise Applications): getProperty> tagReturns the BEAN property value, converts it to a string, and inserts it into the output page.

Syntax:
<Jsp (preferred for SUN Enterprise Applications): getProperty name = "name" property = "propertyName"/>

Note:
1. Before using <jsp (preferred for SUN Enterprise Applications): getProperty>, you must use <jsp (preferred for SUN Enterprise Applications): useBean> to create it.
2. You cannot use <jsp (preferred for SUN Enterprise Applications): getProperty> to retrieve an indexed attribute.
3. It can be used with the JavaBeans component <jsp (preferred for SUN Enterprise Applications): getProperty>, but cannot be used with Enterprise Java Bean.

V,SetProperty command

<Jsp (preferred for SUN Enterprise Applications): setProperty> tagUsed to set the attribute values in Bean.

Syntax:
<Jsp (preferred for SUN Enterprise Applications): setProperty name = "beanName" prop_expr/>
Among them, prop_expr has the following possible situations:
Property = "*" | property = "propertyName" | property = "propertyName" param = "parameterName" | property = "propertyName" value = "propertyValue"

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.