JSP from shallow to deep (11) — tag library

JSP 1.1 proposes a method of extending JSP flag, which is named "flag library". These libraries allow additional flags like jsp: include or jsp: forward, but they are not prefixed with jsp: and they also attach some features.

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

Each logo library has its own logo library and special documents. To use the tag library, you can use "taglib" directive to indicate where the tag library "description" is. For the blazix flag library, the directive is as follows:

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

"URI" in the above sentence indicates where the description of the flag library is located. The prefix of the flag library is different. This instruction means that we can use BLX: to use the flags in the library. The blazix flag library provides a BLX: getproperty flag. This flag allows users to edit form data. Now, in getname In the JSP file, we add a jsp: usebean and place the form in BLX: getproperty:

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

What's your name? < INPUT TYPE=TEXT NAME=username SIZE=20>

What's your e-mail address? < INPUT TYPE=TEXT NAME=email SIZE=20>

What's your age? < INPUT TYPE=TEXT NAME=age SIZE=4>

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

Then create a from getname JSP to NextPage JSP, you will find that the bean data is automatically displayed in the input area. So now users can edit the data.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>