JSP (11-1)

Source: Internet
Author: User

JSP 1.1 proposes an extended JSP flag method named "flag library ". These libraries allow other logos similar to jsp: include or jsp: forward, but they are not prefixed with jsp: and some features are also attached.

To introduce the flag library, we will use the Blazix flag library as an example in this tutorial. This flag library can only be used on the Blazix server. You can download it for free.

Each logstore has its own logstore special documentation. To use the flag library, you can use "taglib" directive to indicate where the "description" of the library is located. For the Blazix flag library, direve VE is as follows:

<% @ Taglib prefix = "blx" uri = "/blx. tld" %>

In the above sentence, "uri" indicates the description of the Flag library. The prefix of the Flag library is different. This command means that we can use blx: to use the flag in the library. The blx: getProperty flag is provided for the blx flag library. This flag allows users to edit form data. Now, in the GetName. jsp file, we add a jsp: useBean and place the form in blx: getProperty:

<% @ Taglib prefix = "blx" uri = "/blx. tld" %>

<Jsp: useBean id = "user" class = "UserData" scope = "session"/>



<Blx: getProperty name = "user" property = "*">

<Form method = post action = "SaveName. jsp">

Whats your name? <Input type = text name = username SIZE = 20> <BR>

Whats your e-mail address? <Input type = text name = email SIZE = 20> <BR>

Whats your age? <Input type = text name = age SIZE = 4>

<P> <input type = SUBMIT>


</Blx: getProperty>



From the code above, we can find that blx: getProperty does not end with/>, but ends. This statement enters all input fields of the form into blx: getProperty so that they can be correctly modified by the flag library.

Create a connection from GetName. jsp to NextPage. jsp. You will find that bean data is automatically displayed in the input area. Now you can edit the data.

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.