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>

  • 相关阅读:
    C++编写ATM(2)
    【Python排序搜索基本算法】之Dijkstra算法
    Java中List转换为数组,数组转List
    [置顶] 亚信联创实习笔记
    PL/SQL 异常处理程序
    CSS position财产
    malloc()与calloc差异
    Qt5官方demo分析集10——Qt Quick Particles Examples
    栈和堆之间的差
    深入浅出JMS(一)——JMS简要
  • 原文地址:https://www.cnblogs.com/meiproject/p/3603131.html
Copyright © 2011-2022 走看看