Note |
---|
As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details |
Using HttpsRequestCycleProcessor (after 1.4--rc3)
By replacing the default WebRequestCycleProcessor with the HttpsRequestCycleProcessor, you are able to specify secure pages using the @RequireHttps annotation on your pages. If you wanted a little more control... lets say for development you did not want your pages to use https, you could bypass the Switch Protocol code like this.
Code Block |
---|
HttpsConfig config = new HttpsConfig(80,443);
return new HttpsRequestCycleProcessor(config){
@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget target) {
if (getConfigurationType().equals(Application.DEVELOPMENT)){
return target;
} else {
return super.checkSecureIncoming(target);
}
}
@Override
protected IRequestTarget checkSecureOutgoing(IRequestTarget target) {
if (getConfigurationType().equals(Application.DEVELOPMENT)){
return target;
} else {
return super.checkSecureOutgoing(target);
}
}
};
|
For The Entire Application
...