web.xml加入taglib报错

web.xml加入taglib报错
使用MyEclipse开发web项目,所生成的web.xml头部如下:
< web-app xmlns =" http://java.sun.com/xml/ns/j2ee " xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance " version =" 2.4 " xsi:schemaLocation =" http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd " >

等到要在web.xml加入taglib
    <taglib>
        <taglib-uri>/WEB-INF/tiles.tld</taglib-uri>
        <taglib-location>/WEB-INF/tiles.tld</taglib-location>
    </taglib>
始终会报错
后来把头部改为
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

<web-app>
......
</web-app>
终于可以加taglib了,但原来的filter又报错,最后把
filter和filter-mapping放在最前面,终于ok.

你可能感兴趣的:(web.xml加入taglib报错)