Use of common jsp labels

Source: Internet
Author: User

Define entities in jspBean
<Jsp: useBean id = "clu" class = "cn. domain. CacluBean"> </jsp: useBean>
<Jsp: getProperty property = "propertyname" name = "clu"> obtain the bean property value and output the value to the page;

EL expression:$ {Object name}
When an el expression is used to retrieve data, it usually uses a. sign or a. Sign. []

PageContext. findAttribute ("data"); // page, request, session, and application query order

<! -- Create a bean if no bean is found on the page -->
<! -- The content in the TAG body is used only when bean is created (instantiated) -->

Jsp assigns values to bean:
<! -- Assign values manually -->
<Jsp: setProperty property = "age" name = "personbean" value = "23"/>
<! -- Request Parameter Value assignment. The request data supports converting strings into eight basic data types -->
<Jsp: setProperty property = "age" name = "personbean" param = "age"/>
<Jsp: setProperty property = "birthdty" name = "personbean" value = "<% = new Date () %>"/>

<Jsp: setProperty property = "*" name = "clu"> set bean attributes and assign values to beans using all request parameters;

//Import Java class:

<% @ Page import = "cn. domain. *" %>
<! -- Static inclusion: It is included during compilation. All JSPs contained are compiled into a servlet, which is more efficient than dynamic inclusion. -->

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.