Add taglib to web.xml file and use tags in jsp

Add tablib in web.xml file


<taglib>
<taglib-uri>The unique access identifier of the tag library (must be consistent with the uri in the tag library tld description file)</taglib-uri>
<taglib-location> The local path of the tag library tld description file (such as /WEB-INF /mytag.tld)</taglib-location>
</taglib>

Reference tag library in JSP page

            <%@ taglib uri="The unique access identifier of the tag library (must be consistent with the uri in the tag library tld description file)" prefix="The prefix name when using the tag"%> 
            For example: <%@ taglib uri=" http:/ /mytag.sf.net " prefix="myTag"%>

 

Use in JSP pages


<prefix defined above: tag_name attribute name in tag library description file 1=”attribute value” attribute name 2=”attribute value”> (optional) main content</prefix defined above: tag_name in tag library description file> 
such as :<myTag:demo.Viewport northTitle="South" westTitle="West"></myTag:demo.Viewport>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326817655&siteId=291194637