JSF + Prettyfaces, Force login page to redirect to https

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

This topic contains 8 replies, has 3 voices, and was last updated by  Lincoln Baxter III 9 years, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #18356



    I already use Prettyfaces in my project. Now I want to force my login page to always redirect to a https page. is this something that I can realize using a Prettyfaces rule? Thank you.


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


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


    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 ... })


    What do you think? Options for making this better in Rewrite:




    Hey Lincoln,

    I don’t like the first shorthand option because it doesn’t allow to distinguish between permanent and temporary redirects any more.

    The second option looks nicer. But I’m not sure if the captureIn() is a bit “too much”. What about if the “URL building” is done by a separate class. Something like this:


    or with the capturing:




    Yeah, I think we need some kind of API for interacting with various parts of the request or URL in an Operation, like a way to build an manipulation into an operation input.


    Yeah, I agree. I think it makes sense to separate the manipulation from the actual operation. Although I’m not sure there are so many cases except for redirects where that URL has to be manipulated. Perhaps forwards, but is there more?


    Hm, not really sure. We’ll need to play around with this.


    I created an issue for tracking this idea:



    Marking this issue as resolved as there are several ways to do this, just not necessarily the nicest. We’ll track this feature in Issue 55. Thanks! Please feel free to comment or ask more questions.

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

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.