Rewrite configuration not working

Splash Forums Rewrite Users Rewrite configuration not working

This topic contains 2 replies, has 2 voices, and was last updated by  j_l 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27203

    j_l
    Participant

    Hi

    I’m facing an issue with the basic setup on Rewrite for my project. I am using 2.0.12.Final.

    I added the dependencies, and followed the manual to create the configuration and activate it (by using @RewriteConfiguration) annotation. Everything copied from the manual to not miss anything.
    My issue is that I don’i see any logs in my JBoss 5.1.2 at startup of the style
    INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] RewriteFilter starting up…

    There is something confusing to me in the manual. It says that if we are using Servlet 2.5 we should add those entries to the web.xml, but the ‘async-supported’ properties for the filter belongs to Servlet 3.0 so I had to remove it from my web.xml as I am actually using Servlet 2.5. Is this related to my issue? I don’t get any deployment error but it seems like the filter is never registered.

    Any help would be much appreciated.

    Thanks in advance

    Configure Rewrite for Servlet 2.5 or EAR deployments by adding the following to WEB-INF/web.xml
    <listener>
    <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
    </listener>

    <listener>
    <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
    </listener>

    <filter>
    <filter-name>OCPsoft Rewrite Filter</filter-name>
    <filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
    <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
    <filter-name>OCPsoft Rewrite Filter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ASYNC</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    • This topic was modified 1 year, 2 months ago by  j_l.
    #27205

    Hey,

    that’s weird. You should actually either see the startup log message or some kind of deployment error. Perhaps you could use your debugger to check if the filter’s init method is actually called? Perhaps the logging configuration doesn’t work as expected and that’s the reason you don’t see the startup message?

    Christian

    #27210

    j_l
    Participant

    Hi Chistian

    Thanks for your quick response.

    I checked whether init() and doFilter() were actually being called, and they were. This made me think that the issue could be the logging and it came to my mind that I was using slf4j. I saw one comment from you to another member to use and adapter you provide:
    <dependency>
    <groupId>org.ocpsoft.logging</groupId>
    <artifactId>logging-adapter-slf4j</artifactId>
    <version>1.0.2.Final</version>
    </dependency>

    I added it and now it shows my configuration. Now it’s time to play with it.

    Thanks for your help

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.