Class ErrorRedirect

    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorRedirect​(java.lang.String appMapping, java.util.Map<java.lang.Integer,​java.lang.String> pages, SpaSupport spa)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.ws.rs.WebApplicationException getContextError()
      Note: method is not supposed to be used directly as error object is directly available in model: ErrorTemplateView.getError().
      static java.lang.String getContextErrorOriginalUrl()
      Returned string is request.getRequestURI() from original request.
      static boolean hasContextError()  
      boolean redirect​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.ws.rs.WebApplicationException exception)
      Try to redirect error to configured error page.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorRedirect

        public ErrorRedirect​(java.lang.String appMapping,
                             java.util.Map<java.lang.Integer,​java.lang.String> pages,
                             SpaSupport spa)
    • Method Detail

      • redirect

        public boolean redirect​(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.ws.rs.WebApplicationException exception)
        Try to redirect error to configured error page.
        Parameters:
        request - request
        response - response
        exception - error (either simple wrapping for error code or complete stacktrace from rest)
        Returns:
        true if error page found and false if no page configured (no special handling required)
      • getContextError

        public static javax.ws.rs.WebApplicationException getContextError()
        Note: method is not supposed to be used directly as error object is directly available in model: ErrorTemplateView.getError().
        Returns:
        thread bound exception to use in error page rendering or null if no error bound
      • getContextErrorOriginalUrl

        public static java.lang.String getContextErrorOriginalUrl()
        Returned string is request.getRequestURI() from original request.
        Returns:
        url of original page (before redirect to error page)
      • hasContextError

        public static boolean hasContextError()
        Returns:
        true indicate error page rendering, false in all other cases