Skip to content

Instantly share code, notes, and snippets.

@WhyNotHugo
Created October 9, 2013 17:18
Show Gist options
  • Save WhyNotHugo/6904837 to your computer and use it in GitHub Desktop.
Save WhyNotHugo/6904837 to your computer and use it in GitHub Desktop.
package com.assia.dslo.gui.config;
import javax.servlet.ServletContext;
import org.ocpsoft.rewrite.annotation.RewriteConfiguration;
import org.ocpsoft.rewrite.config.Configuration;
import org.ocpsoft.rewrite.config.ConfigurationBuilder;
import org.ocpsoft.rewrite.config.Direction;
import org.ocpsoft.rewrite.servlet.config.Forward;
import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider;
import org.ocpsoft.rewrite.servlet.config.Path;
@RewriteConfiguration
public class URLConfigurationProvider extends HttpConfigurationProvider {
@Override
public int priority() {
return 10;
}
@Override
public Configuration getConfiguration(final ServletContext context) {
return ConfigurationBuilder.begin().addRule().when(Direction.isInbound().and(Path.matches("/login3")))
.perform(Forward.to("/login/login.jsf"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment