web.xml中配置<taglib>标签库,MyEclipse报错,上网搜解决方法如下:
1. 如果是头是这样的<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
在<web-app></web-app>中可以直接添加标签
<taglib>
<taglib-uri>Struts2</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tags.tld</taglib-location>
</taglib>
2. 如果头是这样的
<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">
则需要在<taglib></taglib>外加一个<jsp-config></jsp-config>包住它,如:
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/validator-user.tld</taglib-uri>
<taglib-location>/WEB-INF/validator-user.tld</taglib-location>
</taglib>
</jsp-config>