JSP from simple to deep (11) -- mark the library

Source: Internet
Author: User
Tags tld

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"/>

<HTML>

<Body>

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

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

What's your name? <Input type = text name = username size = 20> <br>

What's your E-mail address? <Input type = text name = Email size = 20> <br>

What's your age? <Input type = text name = age size = 4>

<P> <input type = submit>

</Form>

</Blx: getproperty>

</Body>

</Html>

From aboveCodeWe can find that blx: getproperty does not end with/>, but ends with </blx: getproperty>. 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.