Deployment and invocation of tags in JSP

Source: Internet
Author: User
Tags empty header modify tld
JS 1, first write a (tag Java file)
Header file to include the Packeg+class file's placement path, and then compile the build class file and place it in the appropriate classes directory.
2. Write a JSP or HTML file
Note: In the header file you want to write
<%@ taglib uri= "name is the same as URI name in Web.xml file" prefix= "first"%>
<first: "Name is the same in +tld file"/>
3. Write a TLD file
Note: Modify
<tag>
<name> "corresponds to JSP or HTML" </name>
<tagclass> placement path for class file </tagclass>
<bodycontent>empty</bodycontent>//notice when to use empty when using JSP (related to jsp/html)
<info>info</info>
</tag>
4. Modify Web.xml file to add label
Note: add
<taglib>
<taglib-uri> "Same as JSP or HTML URI name" </taglib-uri>
<taglib-location> "Placement path for TLD files" </taglib-location>
</taglib>

The above is through the XML for transit, such as no XML file operation is as follows:
Only modify the following JSP content:
, write a JSP or HTML file
Note: In the header file you want to write
<%@ taglib uri= "Location of TLD Files" prefix= "a"%>
<first: "Name is the same in +tld file"/>


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.