Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
@Override
    protected IRequestCycleProcessor newRequestCycleProcessor()
    {
    HttpsConfig config = new HttpsConfig(80,443);
    return new HttpsRequestCycleProcessor(config)
    {

			@Override
			        @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);
				}
			}
			
			
        	
        };
}

...