Class ErrorHelperBean

java.lang.Object
org.imixs.workflow.office.util.ErrorHelperBean

@Named @RequestScoped public class ErrorHelperBean extends Object
CDI Bean for handling and extracting meaningful error information from servlet exceptions.

This bean provides utilities for JSF error pages to display user-friendly error messages and detailed debugging information. It automatically traverses exception chains to find the most relevant error messages, prioritizing business exceptions over technical wrapper exceptions.

Usage in JSF pages:

 <h:outputText value="#{errorHelperBean.rootCauseMessage}" />
 <h:outputText value="#{errorHelperBean.fullStackTrace}" />
 

Example Exception Chain Handling:

 ObserverException
   └─ Caused by: SomeWrapperException  
       └─ Caused by: ModelException: "Invalid expression: #{!controller.method()}"
 
 Result: Returns "Invalid expression: #{!controller.method()}" as the root cause message
 
Since:
1.0
Author:
rsoika
See Also:
  • HttpServletRequest
  • FacesContext
  • Constructor Details

    • ErrorHelperBean

      public ErrorHelperBean()
  • Method Details

    • getRootCauseMessage

      public String getRootCauseMessage()
      Retrieves the root cause message from the exception stack
    • getRootCauseType

      public String getRootCauseType()
      Returns the exception type of the root cause
    • getFullStackTrace

      public String getFullStackTrace()
      Returns the full stack trace as formatted string
    • getExceptionChain

      public String getExceptionChain()
      Returns a detailed exception chain with all causes
    • getServletErrorInfo

      public String getServletErrorInfo()
      Gets additional servlet error attributes for debugging