Enum Class RequestCycleSettings.RenderStrategy

All Implemented Interfaces:
Serializable, Comparable<RequestCycleSettings.RenderStrategy>, Constable
Enclosing class:

Enum type for different render strategies
  • Enum Constant Details


      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.


      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.

      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 BookmarkableListenerRequestHandler, because otherwise they wouldn't be bookmarkable.

  • Method Details

    • values

      Returns an array containing the constants of this enum class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null