org.tuckey.web.filters.urlrewrite和tomcat 5.5的问题

时间:2011-06-24 17:44:34

标签: java spring tomcat url-rewriting

我正在使用spring roo开发一个应用程序,我必须在tomcat 5.5中部署它。在开发时我使用jetty并没有问题,但是当我在tomcat中测试它时,我的所有url都是错的,我收到了这条日志消息。

DEBUG http-8080-3 org.springframework.security.context.HttpSessionContextIntegrationFilter - SecurityContextHolder now cleared, as request processing completed
ERROR http-8080-3 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[default] - Servlet.service() para servlet default lanzó excepción
java.lang.IllegalArgumentException: Illegal group reference
    at java.util.regex.Matcher.appendReplacement(Matcher.java:713)
    at org.tuckey.web.filters.urlrewrite.utils.WildcardMatcher.replaceAll(WildcardMatcher.java:118)
    at org.tuckey.web.filters.urlrewrite.RuleBase.matchesBase(RuleBase.java:242)
    at org.tuckey.web.filters.urlrewrite.NormalRule.matches(NormalRule.java:88)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRuleProcessing(RuleChain.java:79)
    at org.tuckey.web.filters.urlrewrite.RuleChain.process(RuleChain.java:133)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:140)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:71)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

当我尝试用符号$替换正则表达式时,我意识到这是url重写的问题。我该如何解决这个问题?

非常感谢。

1 个答案:

答案 0 :(得分:0)

我使用下一版urlrewrite

解决了这个问题
    <dependency>
        <groupId>org.tuckey</groupId>
        <artifactId>urlrewrite</artifactId>
        <version>3.2.0</version>
    </dependency>