|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IRequestCycleSettings
Inteface 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.
Nested Class Summary | |
---|---|
static class |
IRequestCycleSettings.RenderStrategy
Enumerated type for different ways of handling the render part of requests. |
Field Summary | |
---|---|
static IRequestCycleSettings.RenderStrategy |
ONE_PASS_RENDER
All logical parts of a request (the action and render part) are handled within the same request. |
static IRequestCycleSettings.RenderStrategy |
REDIRECT_TO_BUFFER
All logical parts of a request (the action and render part) are handled within the same request, but instead of streaming the render result to the browser directly, the result is cached on the server. |
static IRequestCycleSettings.RenderStrategy |
REDIRECT_TO_RENDER
The render part of a request (opposed to the 'action part' which is either the construction of a bookmarkable page or the execution of a IRequestListener handler) is handled by a seperate request by issueing a redirect request to the browser. |
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 |
getResponseFilters()
|
java.lang.String |
getResponseRequestEncoding()
In order to do proper form parameter decoding it is important that the response and the following request have the same 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)
|
Field Detail |
---|
static final IRequestCycleSettings.RenderStrategy ONE_PASS_RENDER
RequestCycle
to
true (getRequestCycle.setRedirect(true)), after which the behavior will
be like RenderStragegy 'REDIRECT_TO_RENDER'.
This strategy is more efficient than the 'REDIRECT_TO_RENDER' strategy, and doesn't have some of the potential problems of it, it also does not solve the double submit problem. It is however the best option to use when you want to do sophisticated (non-sticky session) clustering.
static final IRequestCycleSettings.RenderStrategy REDIRECT_TO_BUFFER
static final IRequestCycleSettings.RenderStrategy REDIRECT_TO_RENDER
RequestCycle
to false (getRequestCycle.setRedirect(false)).
This pattern solves the 'refresh' problem. While it is a common feature of browsers to refresh/ reload a web page, this results in problems in many dynamic web applications. For example, when you have a link with an event handler that e.g. deletes a row from a list, you usually want to ignore refresh requests after that link is clicked on. By using this strategy, the refresh request only results in the re-rendering of the page without executing the event handler again.
Though it solves the refresh problem, it introduces potential problems, as the request that is logically one, are actually two seperate request. Not only is this less efficient, but this also can mean that within the same request attachement/ detachement of models is done twice (in case you use models in the bookmarkable page constructors and IRequestListener handlers). If you use this strategy, you should be aware of this possibily, and should also be aware that for one logical request, actually two instances of RequestCycle are created and processed.
Method Detail |
---|
void addResponseFilter(IResponseFilter responseFilter)
responseFilter
- The IResponseFilter
that is addedboolean getBufferResponse()
boolean getGatherExtendedBrowserInfo()
a page that polls for client capabilities
. This
method is used by the default implementation of
WebRequestCycle.newClientInfo()
, so if that method is overriden,
there is no guarantee this method will be taken into account.
IRequestCycleSettings.RenderStrategy getRenderStrategy()
java.util.List getResponseFilters()
java.lang.String getResponseRequestEncoding()
Duration getTimeout()
IExceptionSettings.UnexpectedExceptionDisplay getUnexpectedExceptionDisplay()
IExceptionSettings.getUnexpectedExceptionDisplay()
void setBufferResponse(boolean bufferResponse)
bufferResponse
- True if this application should buffer responses.void setGatherExtendedBrowserInfo(boolean gatherExtendedBrowserInfo)
a page that polls for client capabilities
. This
method is used by the default implementation of
WebRequestCycle.newClientInfo()
, so if that method is overriden,
there is no guarantee this method will be taken into account.
gatherExtendedBrowserInfo
- Whether to gather extensive client infovoid setRenderStrategy(IRequestCycleSettings.RenderStrategy renderStrategy)
renderStrategy
- the render strategy that should be used by default.void setResponseRequestEncoding(java.lang.String responseRequestEncoding)
responseRequestEncoding
- The request and response encoding to be used.void setTimeout(Duration timeout)
timeout
- void setUnexpectedExceptionDisplay(IExceptionSettings.UnexpectedExceptionDisplay unexpectedExceptionDisplay)
unexpectedExceptionDisplay
- wicket.settings.IExceptionSettings#setUnexpectedExceptionDisplay(wicket.settings.Settings.UnexpectedExceptionDisplay)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |