I’m using maven and I put urlrewrite.xml under source folder src/main/resources/. Configure web.xml like this:
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>confPath</param-name>
<param-value>classpath:urlrewrite.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
but get err:org.tuckey.web.filters.urlrewrite.UrlRewriteFilter ERROR: unable to find urlrewrite conf file at classpath:urlrewrite.xml. If I put it in the default loc:/WEB-INF/urlrewrite.xml. It works. But I want to conform to the maven specs and put all configurations under resources folder.
Could anyone kindly help me? Thanks.
Use this
and Put the urlrewrite.xml file inside ‘WEB-INF’
This article has the setup instructions.