Package net.sf.archimede.jsf.view

Examples of net.sf.archimede.jsf.view.ExceptionBean


                         ServletResponse response,
                         FilterChain chain)
            throws IOException, ServletException {
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        HttpSession session = httpRequest.getSession();
        ExceptionBean exceptionBean = new ExceptionBean();
      try {
        chain.doFilter(request, response);
            //Before rendering the response
        } catch (ServletException e) {
            Throwable rootCause = e.getRootCause();
            while (rootCause.getCause() != null) {
                rootCause = rootCause.getCause();
            }
            rootCause.printStackTrace();
            exceptionBean.setThrowable(rootCause);
            if (rootCause instanceof AccessDeniedException) {
                //FIXME I18N
                exceptionBean.setExplanation("//Vous n'avez pas les droits nécessaires pour effectuer cette opération");
            } else {
//              FIXME I18N
                exceptionBean.setExplanation("//Une erreur générale s'est produite: ");
            }
        }
       
        if (exceptionBean.getThrowable() != null) {
            session.setAttribute(ExceptionBean.SESSION_REF, exceptionBean);
            HttpServletResponse httpResponse = (HttpServletResponse) response;
            String path = httpRequest.getContextPath() + "/pages/exception/general.xhtml";
            httpResponse.sendRedirect(httpRequest.getContextPath() + "/pages/exception/general.jsf");
        }
View Full Code Here

TOP

Related Classes of net.sf.archimede.jsf.view.ExceptionBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.