sever.xml<Host name="localhost" appBase="D:\myWork\project\webroot" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
  <Context path="?" docBase="?" debug="0" reloadable="true" crossContext="true"/>
</Host>web.xml<jsp-config>
  <taglib>
    <taglib-uri>/system</taglib-uri>
    <taglib-location>/WEB-INF/system.tld</taglib-location>
  </taglib>
</jsp-config>
我把页面都放在了webroot下的一个文件夹下.文件夹的index页面就可以找到<%@ taglib prefix="sys" uri="/system"%>,而其它的页面就报错'File "/system" not found',同时,我在include页面的时候,file属性也不能写成'/该文件夹名/页面.jsp'.否则找不到该页面.请问,是不是我的工程路径配置错误了?是不是在问号那里应该改成什么?谢谢大家帮我看一下...

解决方案 »

  1.   

    自定义标签库时
    taglib-uri 最好采用完整URL,或者包的名字(保证唯一)。
    写成“/xxx”没测试过,建议你改成其他形式。比如:    <taglib>
          <taglib-uri>http://www.xxx.com/taglibs/utils</taglib-uri>
          <taglib-location>/WEB-INF/tld/xxx.tld</taglib-location>
        </taglib>和<%@ taglib prefix="xxx" uri="http://www.xxx.com/taglibs/utils" %>
      

  2.   

    context标签里的path和docbase都指向你自己的相对目录。
      

  3.   

    to xdop: 如果现在是在我本地,我应该改成在web.xml中改成<taglib-uri>http://localhost:10080/taglibs/utils </taglib-uri>,在页面中也是这样,对么?
    to jinxfei: 我应该在sever.xml的path和docbase,加上我的相对目录"\"么?相对于哪个的相对路径?
      

  4.   

    最终的路径要包含有你的视图层<jsp>.
      

  5.   

    我在web.xml里还写了这样的一个配置
    <filter-mapping>
      <filter-name>webwork</filter-name>
      <url-pattern>*.do</url-pattern>
    </filter-mapping>
    在webwork.properties里还写了webwork.action.extension=action,do这句会不会是它们的原因?