Re: JSF + Prettyfaces, Force login page to redirect to https

Splash Forums PrettyFaces Users JSF + Prettyfaces, Force login page to redirect to https Re: JSF + Prettyfaces, Force login page to redirect to https

#22519

Yes, you can do this using a PrettyFaces rewrite processor:

http://ocpsoft.org/docs/prettyfaces/snapshot/en-US/html/inbound_rewriting.html#inbound_rewriting.options

You can also do this easily using the OCPsoft Rewrite framework: http://ocpsoft.org/rewrite/

.defineRule().when(Path.matches("/login").and(Scheme.matches("http"))).perform(Redirect.temporary("https://server.com/login"))

The server URL can be built dynamically as well, but we’ll need to add a few features to make that easier.

You can also do this using your own rule:

.addRule(new RuleBase() { ... define the behavior directly ... })