JSP (11)--tag Library _jsp programming

Source: Internet
Author: User
Tags tld
JSP 1.1 presents a method for extending the JSP flag, which is named "Logo library." These libraries allow other flags similar to those of Jsp:include or jsp:forward, but they are not JSP: prefix and also have some attributes attached to the attachment.

To introduce the logo library, we use the Blazix tag library as an example in this tutorial. This logo library can only be used in Blazix servers, which you can download for free.

Each logo library has its own logo library special document. In order to use the logo library, you can use the "taglib" directive to indicate where the logo library "description" is located. For the Blazix logo library, the directive is as follows:

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

The "uri" in the above sentence indicates where the logo library description is located. The prefix for the tag library is different. This instruction means that we can use the BLX: to use the flags in the library. The Blazix logo Library provides a blx:getproperty flag. This flag allows the user to edit the 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 the above code we can find that Blx:getproperty does not end with/>, but ends with </blx:getProperty>. This statement enters all form input areas into the blx:getproperty so that they can be modified correctly by the tag library.

Then create a connection from getname.jsp to nextpage.jsp, and you'll find the bean's data automatically displayed in the input area. So now the user 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.