org.apache.wicket.settings
Interface IRequestCycleSettings

All Known Implementing Classes:
RequestCycleSettings

public interface IRequestCycleSettings

Interface for request related settings

bufferResponse (defaults to true) - True if the application should buffer responses. This does require some additional memory, but helps keep exception displays accurate because the whole rendering process completes before the page is sent to the user, thus avoiding the possibility of a partially rendered page.

renderStrategy - Sets in what way the render part of a request is handled. Basically, there are two different options:

More documentation is available about each setting in the setter method for the property.

Author:
Igor Vaynberg (ivaynberg)

Nested Class Summary
static class IRequestCycleSettings.RenderStrategy
          Enum type for different render strategies
 
Method Summary
 void addResponseFilter(IResponseFilter responseFilter)
          Adds a response filter to the list.
 boolean getBufferResponse()
           
 boolean getGatherExtendedBrowserInfo()
          Gets whether Wicket should try to get extensive client info by redirecting to a page that polls for client capabilities.
 IRequestCycleSettings.RenderStrategy getRenderStrategy()
          Gets in what way the render part of a request is handled.
 java.util.List<IResponseFilter> getResponseFilters()
           
 java.lang.String getResponseRequestEncoding()
          In order to do proper form parameter encoding it is important that the response and the subsequent request stipulate a common character encoding.
 Duration getTimeout()
          Gets the time that a request will by default be waiting for the previous request to be handled before giving up.
 IExceptionSettings.UnexpectedExceptionDisplay getUnexpectedExceptionDisplay()
           
 void setBufferResponse(boolean bufferResponse)
           
 void setGatherExtendedBrowserInfo(boolean gatherExtendedBrowserInfo)
          Sets whether Wicket should try to get extensive client info by redirecting to a page that polls for client capabilities.
 void setRenderStrategy(IRequestCycleSettings.RenderStrategy renderStrategy)
          Sets in what way the render part of a request is handled.
 void setResponseRequestEncoding(java.lang.String responseRequestEncoding)
          In order to do proper form parameter decoding it is important that the response and the following request have the same encoding.
 void setTimeout(Duration timeout)
          Sets the time that a request will by default be waiting for the previous request to be handled before giving up.
 void setUnexpectedExceptionDisplay(IExceptionSettings.UnexpectedExceptionDisplay unexpectedExceptionDisplay)
           
 

Method Detail

addResponseFilter

void addResponseFilter(IResponseFilter responseFilter)
Adds a response filter to the list. Filters are evaluated in the order they have been added.

Parameters:
responseFilter - The IResponseFilter that is added

getBufferResponse

boolean getBufferResponse()
Returns:
True if this application buffers its responses

getGatherExtendedBrowserInfo

boolean getGatherExtendedBrowserInfo()
Gets whether Wicket should try to get extensive client info by redirecting to a page that polls for client capabilities. This method is used by the default implementation of WebRequestCycle#newClientInfo(), so if that method is overridden, there is no guarantee this method will be taken into account.

Returns:
Whether to gather extensive client info

getRenderStrategy

IRequestCycleSettings.RenderStrategy getRenderStrategy()
Gets in what way the render part of a request is handled.

Returns:
the render strategy

getResponseFilters

java.util.List<IResponseFilter> getResponseFilters()
Returns:
an unmodifiable list of added response filters, null if none

getResponseRequestEncoding

java.lang.String getResponseRequestEncoding()
In order to do proper form parameter encoding it is important that the response and the subsequent request stipulate a common character encoding. possible form encodings and their problems: wicket now uses multipart/form-data for it's forms.

Returns:
The request and response encoding

getTimeout

Duration getTimeout()
Gets the time that a request will by default be waiting for the previous request to be handled before giving up.

Returns:
The time out

getUnexpectedExceptionDisplay

IExceptionSettings.UnexpectedExceptionDisplay getUnexpectedExceptionDisplay()
Returns:
UnexpectedExceptionDisplay
See Also:
IExceptionSettings.getUnexpectedExceptionDisplay()

setBufferResponse

void setBufferResponse(boolean bufferResponse)
Parameters:
bufferResponse - True if this application should buffer responses.

setGatherExtendedBrowserInfo

void setGatherExtendedBrowserInfo(boolean gatherExtendedBrowserInfo)
Sets whether Wicket should try to get extensive client info by redirecting to a page that polls for client capabilities. This method is used by the default implementation of WebRequestCycle#newClientInfo(), so if that method is overridden, there is no guarantee this method will be taken into account.

WARNING: though this facility should work transparently in most cases, it is recommended that you trigger the roundtrip to get the browser info somewhere where it hurts the least. The roundtrip will be triggered the first time you call Session.getClientInfo() for a session, and after the roundtrip a new request with the same info (url, post parameters) is handled. So rather than calling this in the middle of an implementation of a form submit method, which would result in the code of that method before the call to Session.getClientInfo() to be executed twice, you best call Session.getClientInfo() e.g. in a page constructor or somewhere else where you didn't do a lot of processing first.

Parameters:
gatherExtendedBrowserInfo - Whether to gather extensive client info

setRenderStrategy

void setRenderStrategy(IRequestCycleSettings.RenderStrategy renderStrategy)
Sets in what way the render part of a request is handled. Basically, there are two different options:

setResponseRequestEncoding

void setResponseRequestEncoding(java.lang.String responseRequestEncoding)
In order to do proper form parameter decoding it is important that the response and the following request have the same encoding. see http://www.crazysquirrel.com/computing/general/form-encoding.jspx for additional information. Default encoding: UTF-8

Parameters:
responseRequestEncoding - The request and response encoding to be used.

setTimeout

void setTimeout(Duration timeout)
Sets the time that a request will by default be waiting for the previous request to be handled before giving up.

Parameters:
timeout -

setUnexpectedExceptionDisplay

void setUnexpectedExceptionDisplay(IExceptionSettings.UnexpectedExceptionDisplay unexpectedExceptionDisplay)
Parameters:
unexpectedExceptionDisplay -


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