web.xml配置文件 taglib
2014-03-16 11:10
330 查看
web.xml的内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
</web-app>
在MyEclipse中会在taglib那一行有一个错误标志,但是运行的 时候没有问题……
原因:
所使用版本的问题,如果使用2.3版本就可以直接在<web-app>里面写:
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
如果是用的是2.4版本,就不能直接这么写了,应该:
<jsp-config>
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
</jsp-config>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
</web-app>
在MyEclipse中会在taglib那一行有一个错误标志,但是运行的 时候没有问题……
原因:
所使用版本的问题,如果使用2.3版本就可以直接在<web-app>里面写:
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
如果是用的是2.4版本,就不能直接这么写了,应该:
<jsp-config>
<taglib>
<taglib-uri>struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
</jsp-config>
相关文章推荐
- web.xml配置文件 taglib
- 最全web.xml配置文件元素详解
- web.xml文件的作用及基本配置
- java非web应用修改 properties/xml配置文件后,无需重启应用即可生效---自动加载
- 三,基于Java配置、无web.xml文件方式配置Spring MVC
- Web容器配置文件web.xml解析
- jsp web.xml文件的作用及基本配置
- openfire 插件web工程web-custom.xml配置文件说明
- Servlet过滤器web.xml文件配置
- 关于项目中web.xml配置文件里面的spring的配置contextConfigLocation
- [转]web.xml文件中配置<mime-mapping>下载文件类型
- web.xml文件的作用及基本配置
- web.xml文件的作用及基本配置
- web.xml配置文件中ContextLoaderListener的作用
- web.xml中配置spring配置(application.xml)文件
- web.xml配置文件详细解读
- web.xml配置文件详解(转)
- 无敌全web.xml配置文件元素详解
- web.xml配置文件祥解
- web.xml文件的作用及基本配置