org.loom.resolution
Interface ResolutionFactory

All Known Implementing Classes:
DefaultResolutionFactory

public interface ResolutionFactory

A factory for Resolution classes. TODO This class may be redesigned in the future


Method Summary
 ForwardResolution forward(java.lang.String pageName)
          Create a ForwardResolution
 ForwardResolution forwardWithLocale(java.lang.String pageName)
          Forward to a page, with preference for a localized page if possible.
 JacksonResolution json(java.lang.Object contents)
          Sends a JSON serialization of the contents object.
 RedirectResolution redirect(java.lang.Class<? extends Action> actionClass, java.lang.String event)
          Redirects the browser to a different Action and Event
 RedirectResolution redirect(java.lang.String url)
          Redirects the browser to a different URL
 RedirectResolution redirect(java.lang.String action, java.lang.String event)
          Redirects the browser to a different Action and Event
 PersistentFileResolution send(PersistentFile file)
          Sends a persistent file to the browser.
 

Method Detail

forward

ForwardResolution forward(java.lang.String pageName)
Create a ForwardResolution

Parameters:
pageName - the name of the forward destination
Returns:
a ForwardResolution to the provided resource

forwardWithLocale

ForwardResolution forwardWithLocale(java.lang.String pageName)
Forward to a page, with preference for a localized page if possible. A forward to "myfile.jsp" with spanish request locale and english default locale will first try "myfile_es.jsp", then "myfile_en.jsp" and, if none is found, "myfile.jsp"

Parameters:
pageName - the name of the resource to forward to
Returns:
a ForwardResolution to the provided page
See Also:
LocaleForwardResolution

send

PersistentFileResolution send(PersistentFile file)
Sends a persistent file to the browser.


redirect

RedirectResolution redirect(java.lang.String url)
Redirects the browser to a different URL

Parameters:
url - the url for the browser redirection
Returns:
a RedirectResolution pointing to the provided URL

redirect

RedirectResolution redirect(java.lang.String action,
                            java.lang.String event)
Redirects the browser to a different Action and Event

Parameters:
action - the action short or long name
event - the event to be invoked, null for default event
Returns:
a RedirectResolution pointing to the provided URL

redirect

RedirectResolution redirect(java.lang.Class<? extends Action> actionClass,
                            java.lang.String event)
Redirects the browser to a different Action and Event

Parameters:
actionClass - the action class
event - the event to be called, null for default event
Returns:
a RedirectResolution pointing to the provided URL

json

JacksonResolution json(java.lang.Object contents)
Sends a JSON serialization of the contents object.

Parameters:
contents - the contents object to serialize as a JSON object
Returns:
the JSON resolution