【问题标题】:Unable to find urlrewrite conf file at /WEB-INF/urlrewrite.xml无法在 /WEB-INF/urlrewrite.xml 找到 urlrewrite conf 文件
【发布时间】:2012-10-19 17:01:26
【问题描述】:

我正在实现 URL 重写功能,我已经在我的项目中包含了所有必要的内容,即WEB-INF/lib 中的 urlrewritefilter-4.0.3.jar 和 WEB-INF 中的 urlrewrite.xml,并在 web.xml 中添加了以下内容

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

但我收到以下错误,

无法在 /WEB-INF/urlrewrite.xml 找到 urlrewrite 配置文件

请给我一些建议来解决这个问题。

【问题讨论】:

  • 你想在这里发布你的conf文件吗?
  • 在哪里可以找到 conf 文件,是来自 Jboss 还是来自源本身...?
  • 课程来源,webapproot/web-inf/

标签: java jsp struts2 servlet-filters tuckey-urlrewrite-filter


【解决方案1】:

您可以更改参数中的 conf 文件。这可以添加到过滤器配置中。

<!-- if you need to the conf file path can be changed
    it is specified as a path relative to the root of your context
    (default /WEB-INF/urlrewrite.xml) -->
    <init-param>
        <param-name>confPath</param-name>
        <param-value>/WEB-INF/urlrewrite.xml</param-value>
    </init-param>

【讨论】:

  • @varsha 你能发布到 urlrewrite.xml 的绝对路径吗?
  • 这里是路径:/ProjectA/WebContent/WEB-INF/urlrewrite.xml
  • @varsha 您的文件在名称开头有多余的空格/重命名文件并删除空格字符。
  • 谢谢@Roman,你是对的,文件名和指定的路径不匹配
猜你喜欢
  • 1970-01-01
  • 2015-04-26
  • 2015-09-09
  • 2020-11-02
  • 1970-01-01
  • 1970-01-01
  • 2020-06-30
  • 2014-08-17
  • 1970-01-01
相关资源
最近更新 更多