zoukankan      html  css  js  c++  java
  • web.xml配置文件 taglib

     

    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>

  • 相关阅读:
    ajax简单案例
    jquery中的数据传输
    java-Reflect
    Factory Method 和AbstractFactory
    Singleton
    英语六级口语备考指南
    ACM信息汇总
    jquery练习
    char可不可以存汉字
    信息安全
  • 原文地址:https://www.cnblogs.com/meiproject/p/3603131.html
Copyright © 2011-2022 走看看