Class HttpsRequestCycleProcessor

  extended by org.apache.wicket.request.AbstractRequestCycleProcessor
      extended by org.apache.wicket.protocol.http.WebRequestCycleProcessor
          extended by org.apache.wicket.protocol.https.HttpsRequestCycleProcessor
All Implemented Interfaces:

public class HttpsRequestCycleProcessor
extends WebRequestCycleProcessor

Request cycle processor that can switch between http and https protocols based on the RequireHttps annotation. Once this processor is installed, any page annotated with the RequireHttps annotation will be served over https, while any page lacking the annotation will be served over http. The annotation can be placed on a super class or an interface that a page implements. To install this processor:

 class MyApplication extends WebApplication
        protected IRequestCycleProcessor newRequestCycleProcessor()
                return new HttpsRequestCycleProcessor(config);
Notes: According to servlet spec a cookie created on an https request is marked as secure, such cookies are not available for http requests. What this means is that a session started over https will not be propagated to further http calls because JSESSIONID cookie will be marked as secure and not available to http requests. This entails that unless a session is created and bound on http prior to using an https request any wicket pages or session values stored in the https session will not be available to further http requests. If your application requires a http->https->http interactions (such as the case where only a login page and my account pages are secure) you must make sure a session is created and stored in the http request prior to the first http->https redirect.

Constructor Summary
HttpsRequestCycleProcessor(HttpsConfig httpsConfig)
Method Summary
protected  IRequestTarget checkSecure(IRequestTarget target)
          Deprecated. use checkSecureIncoming
protected  IRequestTarget checkSecureIncoming(IRequestTarget target)
protected  IRequestTarget checkSecureOutgoing(IRequestTarget target)
 HttpsConfig getConfig()
 IRequestTarget resolve(RequestCycle rc, RequestParameters rp)
           Resolves the request and returns the request target.
 void respond(RequestCycle requestCycle)
          After the target is resolved and the request events are handled, it is time to respond to the request.
Methods inherited from class org.apache.wicket.protocol.http.WebRequestCycleProcessor
Methods inherited from class org.apache.wicket.request.AbstractRequestCycleProcessor
getRequestCodingStrategy, onRuntimeException, processEvents, resolveBookmarkablePage, resolveExternalResource, resolveHomePageTarget, resolveListenerInterfaceTarget, resolveRenderedPage, resolveSharedResource, respond
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public HttpsRequestCycleProcessor(HttpsConfig httpsConfig)

httpsConfig - configuration
Method Detail


public HttpsConfig getConfig()


protected IRequestTarget checkSecure(IRequestTarget target)
Deprecated. use checkSecureIncoming


protected IRequestTarget checkSecureIncoming(IRequestTarget target)


protected IRequestTarget checkSecureOutgoing(IRequestTarget target)


public IRequestTarget resolve(RequestCycle rc,
                              RequestParameters rp)

Resolves the request and returns the request target. Typically, the resolver uses the RequestParameters object that is passed in.

Implementors of this method should be careful not to mix this code with event handling code; method IRequestCycleProcessor.processEvents(RequestCycle) is meant for that purpose.

Specified by:
resolve in interface IRequestCycleProcessor
resolve in class WebRequestCycleProcessor
rc - the current request cycle
rp - The request parameters object as decoded by this processor's IRequestCodingStrategy.
the request target; has to be non-null!
See Also:
IRequestCycleProcessor.resolve(org.apache.wicket.RequestCycle, org.apache.wicket.request.RequestParameters)


public void respond(RequestCycle requestCycle)
After the target is resolved and the request events are handled, it is time to respond to the request. This method is responsible for executing the proper response sequence given the current request target and response.

Specified by:
respond in interface IRequestCycleProcessor
respond in class AbstractRequestCycleProcessor
requestCycle - the current request cycle
See Also:

Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.