net.sourceforge.stripes.controller
Class DefaultActionBeanContextFactory
java.lang.Object
net.sourceforge.stripes.controller.DefaultActionBeanContextFactory
- All Implemented Interfaces:
- ConfigurableComponent, ActionBeanContextFactory
public class DefaultActionBeanContextFactory
- extends Object
- implements ActionBeanContextFactory
Implements an ActionBeanContextFactory that allows for instantiation of application specific
ActionBeanContext classes. Looks for a configuration parameters called "ActionBeanContext.Class".
If the property is present, the named class with be instantiated and returned from the
getContextInstance() method. If no class is named, then the default class, ActionBeanContext
will be instantiated.
- Author:
- Tim Fennell
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTEXT_CLASS_NAME
public static final String CONTEXT_CLASS_NAME
- The name of the configuration property used for the context class name.
- See Also:
- Constant Field Values
DefaultActionBeanContextFactory
public DefaultActionBeanContextFactory()
init
public void init(Configuration configuration)
throws Exception
- Stores the configuration, and looks up the ActionBeanContext class specified.
- Specified by:
init
in interface ConfigurableComponent
- Parameters:
configuration
- the Configuration object being used by Stripes
- Throws:
Exception
- should be thrown if the component cannot be configured well enough to use.
getContextInstance
public ActionBeanContext getContextInstance(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
- Returns a new instance of the configured class, or ActionBeanContext if a class is
not specified.
- Specified by:
getContextInstance
in interface ActionBeanContextFactory
- Parameters:
request
- the current HttpServletRequestresponse
- the current HttpServletResponse
- Returns:
- a new instance of ActionBeanContext
- Throws:
ServletException
- if the ActionBeanContext class configured cannot be instantiated
getConfiguration
protected Configuration getConfiguration()
setConfiguration
protected void setConfiguration(Configuration configuration)
? Copyright 2005-2006, Stripes Development Team.