The magical application of taglib tags in Jsp

Source: Internet
Author: User
Tags tld

This sentence <%@ taglib prefix= "s" uri= "/struts-tags"%> is from the address/struts-tags looking for a tag library, perhaps someone will wonder where this address? The answer is that it's defined in the Struts 2 library file Struts2-core-2.0.11.jar inside the file Meta-inf/struts-tags.tld inside, at the beginning of this file there is such a piece of code:

<?xml version= "1.0" encoding= "UTF-8"?>

<! DOCTYPE taglib Public "-//sun Microsystems, Inc.//dtd JSP Tag Library 1.2//en" "http://java.sun.com/dtd/ Web-jsptaglibrary_1_2.dtd ">

<taglib>

<tlib-version>2.2.3</tlib-version>

<jsp-version>1.2</jsp-version>

<short-name>s</short-name>

<uri>/struts-tags</uri>

....

You can notice that the <uri>/struts-tags</uri> of the coarse italic is exactly the same as the URI attribute of the JSP file introduced in the Taglib declaration, so that the corresponding label definition position is found. Web servers such as Tomcat automatically load the. TLD tag definition file under the Meta-inf subdirectory under all jar files, which is why many frameworks do not need to copy TLD files to Web-inf.

The magical application of taglib tags in Jsp

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.