com.veriplace.web.views
Interface StatusViewRenderer

All Known Implementing Classes:
AbstractStatusViewRenderer, ServletStatusViewRenderer, SpringStatusViewRenderer

public interface StatusViewRenderer

Interface for an object that can display "status views" to the end user under certain conditions. These include errors (failed location request) and intermediate steps in a request flow (a "please wait" page). To avoid dependencies on any specific web application framework, Veriplace abstracts this process into an interface.

The SDK includes simple implementations of this interface for servlets (ServletStatusViewRenderer) and Spring servlets (SpringStatusViewRenderer). If you use the AbstractVeriplaceServlet class or the JSP tags, a ServletStatusViewRenderer is created for you; see VeriplaceServletHelper for how to customize its properties. Spring applications should define their own SpringStatusViewRenderer bean if desired.

You do not need to use a StatusViewRenderer at all, as long as your code checks for exceptions and returns the appropriate output. Be sure to handle the WaitingException if you will be making asynchronous requests.

Since:
2.0

Method Summary
 boolean canRenderWaitingView()
          Returns true if this StatusViewRenderer is able to display content for the "please wait" condition.
 boolean renderErrorView(HttpServletRequest request, HttpServletResponse response, VeriplaceState state, java.lang.Exception exception)
          Displays an appropriate error response for a given exception.
 boolean renderWaitingView(HttpServletRequest request, HttpServletResponse response, VeriplaceState state, java.lang.String callbackUrl)
          Displays appropriate content for the "please wait" condition.
 

Method Detail

renderErrorView

boolean renderErrorView(HttpServletRequest request,
                        HttpServletResponse response,
                        VeriplaceState state,
                        java.lang.Exception exception)
                        throws StatusViewException,
                               ServletException
Displays an appropriate error response for a given exception.

Throws:
StatusViewException - if there was an error in rendering the view
ServletException

renderWaitingView

boolean renderWaitingView(HttpServletRequest request,
                          HttpServletResponse response,
                          VeriplaceState state,
                          java.lang.String callbackUrl)
                          throws StatusViewException,
                                 ServletException
Displays appropriate content for the "please wait" condition.

Parameters:
callbackUrl - the URL to use for an automatic refresh
Throws:
StatusViewException - if there was an error in rendering the view
ServletException

canRenderWaitingView

boolean canRenderWaitingView()
Returns true if this StatusViewRenderer is able to display content for the "please wait" condition. If it returns false, renderWaitingView(HttpServletRequest, HttpServletResponse, VeriplaceState, String) will never be called.