|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ActionResolver
Resolvers are responsible for locating ActionBean instances that can handle the submitted request. Once an appropriate ActionBean has been identified the ActionResolver is also responsible for identifying the individual method on the ActionBean class that should handle this specific request.
Throughout this class two terms are used that refer to similar but not interchangeable
concepts. UrlBinding
refers to the exact URL to which a bean is bound, e.g.
/account/Profile.action
. Path
refers to the path segment of the requested
URL and is generally composed of the URL binding and possibly some additional information,
e.g. /account/Profile.action/edit
. In general the methods in this class are capable
of taking in a path
and extracting the UrlBinding
from it.
Field Summary | |
---|---|
static String |
RESOLVED_ACTION
Key that is to be used by ActionResolvers to store, as a request attribute, the action that was resolved in the current request. |
Method Summary | |
---|---|
ActionBean |
getActionBean(ActionBeanContext context)
Resolves the Class, implementing ActionBean, that should be used to handle the request. |
ActionBean |
getActionBean(ActionBeanContext context,
String path)
Returns the ActionBean class that responds to the path provided. |
Collection<Class<? extends ActionBean>> |
getActionBeanClasses()
Get all the classes implementing ActionBean that are recognized by this
ActionResolver . |
Class<? extends ActionBean> |
getActionBeanType(String path)
Fetches the Class representing the type of ActionBean that has been bound to the URL contained within the path supplied. |
Method |
getDefaultHandler(Class<? extends ActionBean> bean)
Locates and returns the default handler method that should be invoked when no specific event is named. |
String |
getEventName(Class<? extends ActionBean> bean,
ActionBeanContext context)
Determines the name of the event fired by the front end. |
String |
getHandledEvent(Method handler)
Returns the name of the event to which a given handler method responds. |
Method |
getHandler(Class<? extends ActionBean> bean,
String eventName)
Resolves the Method which handles the named event. |
String |
getUrlBinding(Class<? extends ActionBean> clazz)
Takes a class that implements ActionBean and returns the URL binding of that class. |
String |
getUrlBindingFromPath(String path)
Returns the URL binding that is a substring of the path provided. |
Methods inherited from interface net.sourceforge.stripes.config.ConfigurableComponent |
---|
init |
Field Detail |
---|
static final String RESOLVED_ACTION
Method Detail |
---|
String getUrlBindingFromPath(String path)
/user/Profile.action
, invoking
getUrlBindingFromPath("/user/Profile.action/view"
should return
"/user/Profile.action"
.
path
- the path being used to access an ActionBean, either in a form or link tag,
or in a request that is hitting the DispatcherServlet.
ActionBean getActionBean(ActionBeanContext context) throws StripesServletException
context
- the ActionBeanContext for the current request
StripesServletException
- thrown if a ActionBean cannot be resolved for any reasonActionBean getActionBean(ActionBeanContext context, String path) throws StripesServletException
context
- the current action bean contextpath
- the path segment of the request (or link or action)
StripesServletException
- if a matching ActionBean cannot be foundClass<? extends ActionBean> getActionBeanType(String path)
path
- the path segment of a request url or form action or link
String getUrlBinding(Class<? extends ActionBean> clazz)
clazz
- a class that implements ActionBean
String getEventName(Class<? extends ActionBean> bean, ActionBeanContext context)
bean
- the ActionBean type that has been bound to the requestcontext
- the ActionBeanContext for the current request
Method getHandler(Class<? extends ActionBean> bean, String eventName) throws StripesServletException
bean
- the ActionBean type that has been bound to the requesteventName
- the named event being handled by the ActionBean
StripesServletException
- thrown if a method cannot be resolved for any reason,
including but not limited to, when a Method does not exist that handles the event.Method getDefaultHandler(Class<? extends ActionBean> bean) throws StripesServletException
bean
- the ActionBean type that has been bound to the request
StripesServletException
- thrown if a default handler method cannot be found.String getHandledEvent(Method handler) throws StripesServletException
handler
- the handler method who's event name to find
StripesServletException
Collection<Class<? extends ActionBean>> getActionBeanClasses()
ActionBean
that are recognized by this
ActionResolver
. This method must return the full set of ActionBean
classes
after the call to init().
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |