站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

SimpleControllerHandlerAdapter (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.web.portlet.mvc
Class SimpleControllerHandlerAdapter

java.lang.Object
  extended by org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter
All Implemented Interfaces:
HandlerAdapter

public class SimpleControllerHandlerAdapter
extends Object
implements HandlerAdapter

Adapter to use the Controller workflow interface with the generic DispatcherPortlet.

This is an SPI class, not used directly by application code.

Since:
2.0
Author:
John A. Lewis
See Also:
DispatcherPortlet, Controller

Constructor Summary
SimpleControllerHandlerAdapter()
           
 
Method Summary
 void handleAction(ActionRequest request, ActionResponse response, Object handler)
          Use the given handler to handle this action request.
 ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
          Use the given handler to handle this render request.
 boolean supports(Object handler)
          Given a handler instance, return whether or not this HandlerAdapter can support it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleControllerHandlerAdapter

public SimpleControllerHandlerAdapter()
Method Detail

supports

public boolean supports(Object handler)
Description copied from interface: HandlerAdapter
Given 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);

Specified by:
supports in interface HandlerAdapter
Parameters:
handler - handler object to check
Returns:
whether or not this object can use the given handler

handleAction

public void handleAction(ActionRequest request,
                         ActionResponse response,
                         Object handler)
                  throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this action request. The workflow that is required may vary widely.

Specified by:
handleAction in interface HandlerAdapter
Parameters:
request - current action request
response - current action response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws:
Exception - in case of errors

handleRender

public ModelAndView handleRender(RenderRequest request,
                                 RenderResponse response,
                                 Object handler)
                          throws Exception
Description copied from interface: HandlerAdapter
Use the given handler to handle this render request. The workflow that is required may vary widely.

Specified by:
handleRender in interface HandlerAdapter
Parameters:
request - current render request
response - current render response
handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns:
ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws:
Exception - in case of errors

The Spring Framework

Copyright © 2002-2007 The Spring Framework.