Re: Redirect request.contextPath for HTTPS protocol

Splash Forums PrettyFaces Users Redirect request.contextPath for HTTPS protocol Re: Redirect request.contextPath for HTTPS protocol

#20663

What exactly is your requirement? Do you want to redirect the user to the https:// URL every time he tries to use http://?

I’m note sure if you can handle this with existing PrettyFaces features. But many special use cases can be implemented by building a customer rewrite processor:

http://ocpsoft.com/docs/prettyfaces/3.2.0/en-US/html/inbound_rewriting.html

Perhaps something like this:

<rewrite processor="com.example.ForceSSLProcessor" />

public class ForceSSLProcessor implements Processor {

public String process(final RewriteRule rewrite, final String url) {
return url.replaceAll("^http://", "https://");
}

}