MyEclipse中会在taglib那一行有一个错误标志,但是运行的 时候没有问题
2016-03-15 15:37
537 查看
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>
相关文章推荐
- 排序算法-选择与插入排序
- 单链表和双向链表java实现
- Java量与变量的区别
- 【leetcode】【189】Rotate Array
- JAVA线程知识点
- Spring 事务中 readOnly 的解释
- Spring 事务
- Spring学习笔记
- java jacob office转换成pdf
- [JavaEE笔记]Cookie
- Java并发编程:进程和线程的由来(转)
- Spring,hibernate,struts的面试笔试题及答案
- JAVA jacob office转换pdf代码
- spring 事务管理方式及配置
- 【leetcode】【173】Binary Search Tree Iterator
- SSH整合 ----- 充分利用jar包资源 ---- 之struts篇
- Java关于阶乘和二进制“1”的个数的算法题
- 第100001个素数是什么?_蓝桥杯
- struts2学习笔记
- struts2学习笔记