类 SimpleControllerHandlerAdapter
- java.lang.Object
- org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
- 所有已实现的接口:
Aware,PortletContextAware,HandlerAdapter
public class SimpleControllerHandlerAdapter extends Object implements HandlerAdapter, PortletContextAware
Adapter to use the Controller workflow interface with the generic DispatcherPortlet.This is an SPI class, not used directly by application code.
- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, John A. Lewis
- 另请参阅:
DispatcherPortlet,Controller,ResourceAwareController,EventAwareController
构造器概要
构造器 构造器 说明 SimpleControllerHandlerAdapter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidhandleAction(ActionRequest request, ActionResponse response, Object handler)Use the given handler to handle this action request.voidhandleEvent(EventRequest request, EventResponse response, Object handler)Use the given handler to handle this event request.ModelAndViewhandleRender(RenderRequest request, RenderResponse response, Object handler)Use the given handler to handle this render request.ModelAndViewhandleResource(ResourceRequest request, ResourceResponse response, Object handler)Use the given handler to handle this resource request.voidsetPortletContext(PortletContext portletContext)Set the PortletContext that this object runs in.booleansupports(Object handler)Given a handler instance, return whether or not this HandlerAdapter can support it.
构造器详细资料
SimpleControllerHandlerAdapter
public SimpleControllerHandlerAdapter()
方法详细资料
setPortletContext
public void setPortletContext(PortletContext portletContext)
从接口复制的说明:PortletContextAwareSet the PortletContext that this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.
- 指定者:
setPortletContext在接口中PortletContextAware- 参数:
portletContext- PortletContext object to be used by this object
supports
public boolean supports(Object handler)
从接口复制的说明:HandlerAdapterGiven a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.A typical implementation:
return (handler instanceof MyHandler);- 指定者:
supports在接口中HandlerAdapter- 参数:
handler- handler object to check- 返回:
- whether or not this object can use the given handler
handleAction
public void handleAction(ActionRequest request, ActionResponse response, Object handler) throws Exception
从接口复制的说明:HandlerAdapterUse the given handler to handle this action request. The workflow that is required may vary widely.- 指定者:
handleAction在接口中HandlerAdapter- 参数:
request- current action requestresponse- current action responsehandler- handler to use. This object must have previously been passed to thesupportsmethod of this interface, which must have returned true.- 抛出:
Exception- in case of errors- 另请参阅:
Portlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
handleRender
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler) throws Exception
从接口复制的说明:HandlerAdapterUse the given handler to handle this render request. The workflow that is required may vary widely.- 指定者:
handleRender在接口中HandlerAdapter- 参数:
request- current render requestresponse- current render responsehandler- handler to use. This object must have previously been passed to thesupportsmethod of this interface, which must have returnedtrue.- 返回:
- ModelAndView object with the name of the view and the required model data, or
nullif the request has been handled directly - 抛出:
Exception- in case of errors- 另请参阅:
Portlet.render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
handleResource
public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler) throws Exception
从接口复制的说明:HandlerAdapterUse the given handler to handle this resource request. The workflow that is required may vary widely.- 指定者:
handleResource在接口中HandlerAdapter- 参数:
request- current render requestresponse- current render responsehandler- handler to use. This object must have previously been passed to thesupportsmethod of this interface, which must have returnedtrue.- 返回:
- ModelAndView object with the name of the view and the required model data, or
nullif the request has been handled directly - 抛出:
Exception- in case of errors- 另请参阅:
ResourceServingPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
handleEvent
public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception
从接口复制的说明:HandlerAdapterUse the given handler to handle this event request. The workflow that is required may vary widely.- 指定者:
handleEvent在接口中HandlerAdapter- 参数:
request- current action requestresponse- current action responsehandler- handler to use. This object must have previously been passed to thesupportsmethod of this interface, which must have returned true.- 抛出:
Exception- in case of errors- 另请参阅:
EventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)