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.

Author:
Ignacio Coloma

Constructor Summary
ActionContext()
           
 
Method Summary
 void addError(Message message)
           
 Message addError(java.lang.String messageKey)
           
 Message addError(java.lang.String normalizedPropertyPath, java.lang.String messageKey)
           
 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()
           
 java.lang.String getParam(java.lang.String propertyPath)
          Returns the current value of a property, as a parameter to add to a URL
 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.

getParam

public java.lang.String getParam(java.lang.String propertyPath)
Returns the current value of a property, as a parameter to add to a URL

Parameters:
propertyPath - the propertyPath to be obtained as text
Returns:
the UrlParameter with the property value, null if there is no parsed action or the value is null

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)

addError

public Message addError(java.lang.String normalizedPropertyPath,
                        java.lang.String messageKey)

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

addError

public Message addError(java.lang.String messageKey)

addError

public void addError(Message message)

setEvent

public void setEvent(Event event)


The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.