Package org.shredzone.commons.view
Class EmptyViewInterceptor
- java.lang.Object
-
- org.shredzone.commons.view.EmptyViewInterceptor
-
- All Implemented Interfaces:
ViewInterceptor
@ParametersAreNonnullByDefault public class EmptyViewInterceptor extends Object implements ViewInterceptor
AViewInterceptor
that does nothing. May be used as a base class for interceptor implementations.- Author:
- Richard "Shred" Körber
-
-
Constructor Summary
Constructors Constructor Description EmptyViewInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
onErrorResponse(ErrorResponseException ex, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Called when anErrorResponseException
occured.String
onRendering(String template, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Called when a ViewHandler successfully processed the request and returned a template string that is now to be rendered.void
onRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Called when a HTTP request was sent to the view service.void
onViewHandlerInvocation(ViewContext context, Object bean, Method method)
Called when a ViewHandler is about to be invoked.
-
-
-
Constructor Detail
-
EmptyViewInterceptor
public EmptyViewInterceptor()
-
-
Method Detail
-
onRequest
public void onRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Description copied from interface:ViewInterceptor
Called when a HTTP request was sent to the view service. The request has not yet been processed.- Specified by:
onRequest
in interfaceViewInterceptor
- Parameters:
req
-HttpServletRequest
to be handledresp
-HttpServletResponse
with the response
-
onViewHandlerInvocation
public void onViewHandlerInvocation(ViewContext context, Object bean, Method method)
Description copied from interface:ViewInterceptor
Called when a ViewHandler is about to be invoked.- Specified by:
onViewHandlerInvocation
in interfaceViewInterceptor
- Parameters:
context
-ViewContext
passed to the view handlerbean
- Spring bean containing the view handlermethod
- View handler method that will be invoked
-
onRendering
public String onRendering(String template, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Description copied from interface:ViewInterceptor
Called when a ViewHandler successfully processed the request and returned a template string that is now to be rendered. The interceptor can change the template name.- Specified by:
onRendering
in interfaceViewInterceptor
- Parameters:
template
- Template name returned by the view handlerreq
-HttpServletRequest
that was handledresp
-HttpServletResponse
with the response- Returns:
- a different template name, or
null
for keeping the original template name
-
onErrorResponse
public boolean onErrorResponse(ErrorResponseException ex, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Description copied from interface:ViewInterceptor
Called when anErrorResponseException
occured. The interceptor is able to catch the error.- Specified by:
onErrorResponse
in interfaceViewInterceptor
- Parameters:
ex
-ErrorResponseException
that occuredreq
-HttpServletRequest
that led to this errorresp
-HttpServletResponse
with the response- Returns:
true
if the interceptor responded to the error. Other interceptors will not be invoked, and theHttpServletResponse
is sent back.false
if the error handling shall be continued.
-
-