struts2 tag

来源:互联网 发布:淘宝模特天天 编辑:程序博客网 时间:2024/05/29 10:03

struts2 :<%@ taglib prefix="s" uri="/struts-tags" %>
jstl:<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

自定义:<%@ taglib prefix="abc" uri="WEB-INF/tlds/testlib.tld"  %>

在jsp页面上引用  自定义的时候,我没看以看到  uri="WEB-INF/tlds/testlib.tld" ,可以自动这个tld的存放位置

struts2标签 和 jstl标签 的 uri 所指的位置 在哪里呢?

struts2: struts2-core-xxx.jar/META-INF/struts-tags.tld

这这个文件里有

这样一段代码,其中的

<uri>/struts-tags</uri> 便是我没页面上的 uri="/struts-tags"

那程序是怎样找到这个文件呢?

tomcat等服务器在载入项目时候,会自动加载 jar包下的 META-INF下的tld文件

同理:

jstl: standard-xxx.jar/META-INF/c.tld