|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MVC framework SPI interface, allowing parameterization of core MVC workflow.
Interface that must be implemented for each handler type to handle a request. This interface is used to allow the DispatcherServlet to be indefinitely extensible. The DispatcherServlet accesses all installed handlers through this interface, meaning that it does not contain code specific to any handler type.
Note that a handler can be of type Object. This is to enable handlers from other frameworks to be integrated with this framework without custom coding.
This interface is not intended for application developers. It is available to handlers who want to develop their own web workflow.
Note: Implementations can implement the Ordered interface to be able to specify a sorting order and thus a priority for getting applied by DispatcherServlet. Non-Ordered instances get treated as lowest priority.
SimpleControllerHandlerAdapter
Method Summary | |
long |
getLastModified(javax.servlet.http.HttpServletRequest request,
java.lang.Object handler)
Same contract as for HttpServlet.getLastModified. |
ModelAndView |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler)
Use the given handler to handle this request. |
boolean |
supports(java.lang.Object handler)
Given a handler instance, return whether or not this HandlerAdapter can support it. |
Method Detail |
public boolean supports(java.lang.Object handler)
A typical implementation:
return handler != null && MyHandler.class.isAssignableFrom(handler.getClass());
handler
- handler object to check
public ModelAndView handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler) throws java.lang.Exception
request
- current HTTP requestresponse
- current HTTP responsehandler
- handler to use. This object must have previously been passed
to the supports() method of this interface, which must have returned true.
Implementations that generate output themselves (and return null
from this method) may encounter IOExceptions.
java.lang.Exception
- in case of errorspublic long getLastModified(javax.servlet.http.HttpServletRequest request, java.lang.Object handler)
request
- current HTTP requesthandler
- handler to use
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest)
,
LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |