Giter Site home page Giter Site logo

Comments (4)

BalusC avatar BalusC commented on May 31, 2024

I wonder what exactly you'd like to do in resetResponse() and renderErrorPageView() instead as changing them would violate the purpose of FullAjaxExceptionHandler of showing an <error-page> exactly the same way as during a synchronous request.

Those constants are since OmniFaces 2.0 replaced by Servlet 3.0 ones.

from omnifaces.

ova2 avatar ova2 commented on May 31, 2024

I can not remember about resetResponse (have to look into the project code), but renderErrorPageView is e.g. needed to be able to show an error on the same page. We only show unexpected errors on a separate page. Business errors are shown on the same page by invoking navigate in the NavigationHandler with the outcome null. Business errors are thrown across the whole web app and we don't need to change the view for them because the user can continue his/her work. I try to summarize: all exceptions should be treated in the same ExceptionHandler, but the handling differs in exception's type - some exceptions are shown on the current page and some on the separate page.

from omnifaces.

BalusC avatar BalusC commented on May 31, 2024

Closing off as this actually defeats purpose of FullAjaxExceptionHandler.

To implement the desired functionaliry, better override shouldHandleExceptionRootCause().

protected boolean shouldHandleExceptionRootCause(FacesContext context, Throwable exception) {
    if (isContinuableBusinessException(exception)) { 
        return true;
    }
    else {
        // Do your specific thing here. Show a faces message?
        // ...
        return false;
    }
}

from omnifaces.

meprabu avatar meprabu commented on May 31, 2024

Hi I tried the above logic to show my business exception on the same page but i dont the values that i set in the context in the xhtml. This is the response that i get.

class gov.ms.mdes.access.framework.exception.BaseRunTimeException

Please see the code here
http://stackoverflow.com/questions/34144536/omnifaces-fullajaxexceptionhandler

from omnifaces.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.