org.apache.wicket.settings
Enum IRequestCycleSettings.RenderStrategy

java.lang.Object
  extended by java.lang.Enum<IRequestCycleSettings.RenderStrategy>
      extended by org.apache.wicket.settings.IRequestCycleSettings.RenderStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<IRequestCycleSettings.RenderStrategy>
Enclosing interface:
IRequestCycleSettings

public static enum IRequestCycleSettings.RenderStrategy
extends java.lang.Enum<IRequestCycleSettings.RenderStrategy>

Enum type for different render strategies


Enum Constant Summary
ONE_PASS_RENDER
          All logical parts of a request (the action and render part) are handled within the same request.
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.
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 separate request by issuing a redirect request to the browser.
 
Method Summary
static IRequestCycleSettings.RenderStrategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static IRequestCycleSettings.RenderStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ONE_PASS_RENDER

public static final IRequestCycleSettings.RenderStrategy ONE_PASS_RENDER
All logical parts of a request (the action and render part) are handled within the same request.

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.


REDIRECT_TO_BUFFER

public static final 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. A client side redirect command is issued to the browser specifically to render this request.


REDIRECT_TO_RENDER

public static final 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 separate request by issuing a redirect request to the browser. This is commonly known as the 'redirect after submit' pattern, though in our case, we use it for GET and POST requests instead of just the POST requests.

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 separate request. Not only is this less efficient, but this also can mean that within the same request attachment/ detachment 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 possibility, and should also be aware that for one logical request, actually two instances of RequestCycle are created and processed.

Also, even with this strategy set, it is ignored for instances of BookmarkableListenerInterfaceRequestHandler, because otherwise they wouldn't be bookmarkable.

Method Detail

values

public static IRequestCycleSettings.RenderStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (IRequestCycleSettings.RenderStrategy c : IRequestCycleSettings.RenderStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static IRequestCycleSettings.RenderStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


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