首页 > Web开发 > 详细

web.xml配置文件 taglib

时间:2014-03-17 07:09:27      阅读:475      评论:0      收藏:0      [点我收藏+]
 

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>

web.xml配置文件 taglib,布布扣,bubuko.com

web.xml配置文件 taglib

原文:http://www.cnblogs.com/meiproject/p/3603131.html

(0)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!