myeclipse xml editor提示 web.xml中的和servlet的description的解决办法

在web.xml不认<taglib>解决办法:   
如果是头是这样的<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">    
直接在后面加   
<taglib>  
  <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>  
  <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>  
</taglib>  
如果头是这样的   
<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">  
在后面加   
<jsp-config>  
<taglib>  
  <taglib-uri>/WEB-INF/validator-user.tld</taglib-uri>  
  <taglib-location>/WEB-INF/validator-user.tld</taglib-location>  
</taglib>  
</jsp-config>


其他回答:

红叉没猜错的话应该出现在这里:  
  <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">       
这个是对xml文件结构的验证。


可能是连接不到相关网站   去验证这个文档的结构   所以就出现红叉

建议把J2EE版本改为1.3。。。估计两个错误都是这个原因。

2.4的这样定义的  
   
  <jsp-config>  
  <taglib>  
  <taglib-uri>/tags/struts-html</taglib-uri>  
  <taglib-location>/WEB-INF/struts-html.tld</taglib-location>  
  </taglib>  
   
  <taglib>  
    <taglib-uri>/tags/struts-bean</taglib-uri>  
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>  
    </taglib>  
      
    <taglib>  
    <taglib-uri>/tags/struts-logic</taglib-uri>  
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>  
    </taglib>  
  </jsp-config>



把所有跟jsp设置有关的内容都放在<jsp-config></jsp-config>里面

你可能感兴趣的:(MyEclipse)