Rewrite not starting

Splash Forums Rewrite Users Rewrite not starting

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 1 year, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26503

    snooperman
    Participant

    Hi,

    As the documentation says, if you`ve done everything correctly, you should see:

    <blockquote>RewriteFilter starting up…
    Loaded [1] org.ocpsoft.rewrite.config.ConfigurationProvider [com.example.ExampleRewriteConfiguration<0>]
    RewriteFilter initialized.</blockquote>

    in the console. Well, in my case, this doesn’t show up in the console. What am I missing? I added in pom.xml:

    <!-- Pretty Faces -->
    <dependency>
    	<groupId>org.ocpsoft.rewrite</groupId>
    	<artifactId>rewrite-servlet</artifactId>
    	<version>3.0.0.Alpha3</version>
    </dependency>

    I wrote my ConfigurationProvider

    @RewriteConfiguration
    public class ConfigurationProvider extends HttpConfigurationProvider {
    
    	@Override
    	public Configuration getConfiguration(ServletContext context) {
    		return ConfigurationBuilder.begin()
    				.addRule(Join.path("/home").to("/ui/home.xhtml"))
    				.addRule(Join.path("/login").to("/ui/login.xhtml"))
    				.addRule(Join.path("/index").to("/ui/index.xhtml"))
    				.addRule(Join.path("/profile").to("/ui/profile.xhtml"))
    				.addRule(Join.path("/404").to("/ui/error/404.xhtml")).addRule()
    				.when(Response.isCommitted().and(Direction.isInbound()))
    				.perform(Lifecycle.abort());
    	}
    
    	@Override
    	public int priority() {
    		return 10;
    	}
    
    }
    

    Environment: Tomcat 6, Mojara 2.2.5:

    Oct 26, 2014 8:06:28 PM org.apache.catalina.core.AprLifecycleListener init
    Oct 26, 2014 8:06:28 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:all-stars-web' did not find a matching property.
    Oct 26, 2014 8:06:28 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Oct 26, 2014 8:06:28 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 509 ms
    Oct 26, 2014 8:06:28 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Oct 26, 2014 8:06:28 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
    Oct 26, 2014 8:06:29 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    Oct 26, 2014 8:06:30 PM com.sun.faces.config.ConfigureListener contextInitialized
    INFO: Initializing Mojarra 2.2.5 ( 20140108-1427 https://svn.java.net/svn/mojarra~svn/tags/2.2.5@12761) for context '/all-stars-web'
    Oct 26, 2014 8:06:31 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
    INFO: Running on PrimeFaces 5.1
    Oct 26, 2014 8:06:31 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Oct 26, 2014 8:06:32 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Oct 26, 2014 8:06:32 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/16  config=null
    Oct 26, 2014 8:06:32 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 3489 ms

    Thanks in advance.

    • This topic was modified 1 year, 9 months ago by  snooperman.
    #26505

    You are using Tomcat6, which doesn’t support automatic filter registration. So you will have to register the RewriteFilter manually. Did you do this?

    #26507

    snooperman
    Participant

    Thanks for he reply. No, I did not registered the RewriteFilter. How do I do that?

    #26509
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.