|
JSF-Spring | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.context.support.WebApplicationObjectSupport org.springframework.web.servlet.support.WebContentGenerator org.springframework.web.servlet.mvc.AbstractController de.mindmatters.faces.spring.context.servlet.controller.AbstractFacesController de.mindmatters.faces.spring.context.servlet.controller.SimpleActionController
public class SimpleActionController
This Controller implements an ActionSource
and fullfills completely
the contract of an ActionSource. So this Controller can be used like a
UICommand
which will be fully configured and mapped in the
FacesDispatcherServlet
's
application context.
For more information please have a look at the UICommand
and
ActionSource
documentations.
Field Summary |
---|
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
---|
METHOD_GET, METHOD_HEAD, METHOD_POST |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
SimpleActionController()
|
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Add a new |
MethodBinding |
getAction()
Return the |
MethodBinding |
getActionListener()
Return the |
ActionListener[] |
getActionListeners()
Return the set of registered |
protected ModelAndView |
handleRequestInternal(FacesContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Template method. |
boolean |
isImmediate()
Return a flag indicating that the default |
protected void |
processAction(FacesContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ActionEvent event)
Process the request. |
void |
removeActionListener(ActionListener listener)
Remove an existing |
void |
setAction(MethodBinding action)
Set the |
void |
setActionListener(MethodBinding actionListener)
Set the |
void |
setActionListeners(java.util.List actionListeners)
Sets the list of new ActionListener s interested in being
notified when ActionEvent s occur. |
void |
setActionSource(ActionSource actionSource)
Sets the ActionSource implementation this controller should use
as delegate. |
void |
setImmediate(boolean immediate)
Set the "immediate execution" flag for this |
Methods inherited from class de.mindmatters.faces.spring.context.servlet.controller.AbstractFacesController |
---|
handleRequestInternal |
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController |
---|
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession |
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
---|
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
---|
getServletContext, getTempDir, getWebApplicationContext, isContextRequired, setServletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleActionController()
Method Detail |
---|
protected final ModelAndView handleRequestInternal(FacesContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
handleRequest
.
handleRequestInternal
in class AbstractFacesController
context
- FacesContext
for the current requestrequest
- current HTTP requestresponse
- current HTTP response
null
if handled
directlyAbstractController.handleRequest(HttpServletRequest,
HttpServletResponse)
protected void processAction(FacesContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionEvent event)
setActionListeners(List)
) are
notified and before the Action and ActionListener MethodBinding
s
of this ActionSource
will be processed. May be overriden in
subclasses.
context
- FacesContext
for the current requestrequest
- current HTTP requestresponse
- current HTTP responseevent
- current ActionEventpublic final void setActionSource(ActionSource actionSource)
ActionSource
implementation this controller should use
as delegate. Default ActionSource is a UICommand
instance.
actionSource
- the ActionSource to use for internal purposes.public final void addActionListener(ActionListener listener)
Add a new ActionListener
to the set of listeners interested
in being notified when ActionEvent
s occur.
addActionListener
in interface ActionSource
listener
- The ActionListener
to be addedpublic final MethodBinding getAction()
Return the MethodBinding
pointing at the application
action to be invoked, if this UIComponent
is activated by
the user, during the Apply Request Values or Invoke
Application phase of the request processing lifecycle,
depending on the value of the immediate
property.
getAction
in interface ActionSource
public final MethodBinding getActionListener()
Return the MethodBinding
pointing at an action
listener method to be invoked, if this UIComponent
is
activated by the user, during the Apply Request Values
or Invoke Application phase of the request processing
lifecycle, depending upon the value of the immediate
property.
getActionListener
in interface ActionSource
public final ActionListener[] getActionListeners()
Return the set of registered ActionListener
s for this
ActionSource
instance. If there are no registered listeners,
a zero-length array is returned.
getActionListeners
in interface ActionSource
public final boolean isImmediate()
Return a flag indicating that the default ActionListener
provided by the JavaServer Faces implementation should be executed
immediately (that is, during Apply Request Values phase
of the request processing lifecycle), rather than waiting until the
Invoke Application phase. The default value for this
property must be false
.
isImmediate
in interface ActionSource
public final void removeActionListener(ActionListener listener)
Remove an existing ActionListener
(if any) from the set of
listeners interested in being notified when ActionEvent
s
occur.
removeActionListener
in interface ActionSource
listener
- The ActionListener
to be removedpublic final void setAction(MethodBinding action)
Set the MethodBinding
pointing at the appication
action to be invoked, if this UIComponent
is activated by
the user, during the Apply Request Values or Invoke
Application phase of the request processing lifecycle,
depending on the value of the immediate
property.
Any method referenced by such an expression must be public, with
a return type of String
, and accept no parameters.
setAction
in interface ActionSource
action
- The new MethodBinding expressionpublic final void setActionListener(MethodBinding actionListener)
Set the MethodBinding
pointing at an action listener
method to be invoked, if this UIComponent
is activated by
the user, during the Apply Request Values or Invoke
Application phase of the request processing lifecycle,
depending upon the value of the immmediate
property.
Any method referenced by such an expression must be public, with
a return type of void
, and accept a single parameter of
type ActionEvent
.
setActionListener
in interface ActionSource
actionListener
- The new method binding expressionpublic final void setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent
.
setImmediate
in interface ActionSource
immediate
- The new immediate execution flagpublic final void setActionListeners(java.util.List actionListeners)
ActionListener
s interested in being
notified when ActionEvent
s occur.
actionListeners
- the ActionListener
instance to use
|
JSF-Spring | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |