org.loom.action
Class ActionContext

java.lang.Object
  extended by org.loom.action.ActionContext

public class ActionContext
extends java.lang.Object

Encapsulates the objects associated to this request: request, response, current action mapping, etc.


Constructor Summary
ActionContext()
           
 
Method Summary
 ActionMapping getActionMapping()
           
 java.lang.Object getAttribute(java.lang.String name, Scope scope)
          Gets the value of the requested attribute for the given scope
 Event getEvent()
           
 Messages getMessages()
           
 LoomServletRequest getRequest()
           
 ResolutionFactory getResolutionFactory()
           
 LoomServletResponse getResponse()
           
 javax.servlet.ServletContext getServletContext()
           
 javax.servlet.http.HttpSession getSession()
           
 javax.servlet.http.HttpSession getSession(boolean create)
           
 boolean hasError()
           
 void setAttribute(java.lang.String name, java.lang.Object value, Scope scope)
          Sets an attribute for the given scope
 void setEvent(Event event)
           
 void setRequest(LoomServletRequest request)
           
 void setResolutionFactory(ResolutionFactory resolutionFactory)
           
 void setResponse(LoomServletResponse response)
           
 void setSelectedMenuItem(java.lang.String menuId, java.lang.Class<? extends Action> actionClass, java.lang.String event)
          Sets the currently selected menu item
 void setSelectedMenuItem(java.lang.String menuId, java.lang.String menuItemId)
          Sets the currently selected menu item
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionContext

public ActionContext()
Method Detail

getRequest

public LoomServletRequest getRequest()

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value,
                         Scope scope)
Sets an attribute for the given scope

Parameters:
name - the name of the attribute
value - the value of the attribute
scope - the scope where the attribute should be stored. PAGE is not allowed here.

getAttribute

public java.lang.Object getAttribute(java.lang.String name,
                                     Scope scope)
Gets the value of the requested attribute for the given scope

Parameters:
name - the name of the attribute
scope - the scope where the attribute should be stored. PAGE is not allowed here.

setSelectedMenuItem

public void setSelectedMenuItem(java.lang.String menuId,
                                java.lang.String menuItemId)
Sets the currently selected menu item


setSelectedMenuItem

public void setSelectedMenuItem(java.lang.String menuId,
                                java.lang.Class<? extends Action> actionClass,
                                java.lang.String event)
Sets the currently selected menu item


getEvent

public Event getEvent()

getActionMapping

public ActionMapping getActionMapping()

getSession

public javax.servlet.http.HttpSession getSession()

getSession

public javax.servlet.http.HttpSession getSession(boolean create)

setRequest

public void setRequest(LoomServletRequest request)

getResponse

public LoomServletResponse getResponse()

setResponse

public void setResponse(LoomServletResponse response)

getResolutionFactory

public ResolutionFactory getResolutionFactory()

setResolutionFactory

public void setResolutionFactory(ResolutionFactory resolutionFactory)

getServletContext

public javax.servlet.ServletContext getServletContext()

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)

getMessages

public Messages getMessages()
Returns:
the list of messages of this request

hasError

public boolean hasError()
Returns:
true if any error occurred processing this request

setEvent

public void setEvent(Event event)