Example usage for javax.servlet ServletException getMessage

List of usage examples for javax.servlet ServletException getMessage

Introduction

In this page you can find the example usage for javax.servlet ServletException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.apache.syncope.core.misc.spring.DefaultRolesPrefixPostProcessor.java

@Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) {
    if (bean instanceof DefaultMethodSecurityExpressionHandler) {
        ((DefaultMethodSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }/*www  .  j a v  a 2s . c  o m*/
    if (bean instanceof DefaultWebSecurityExpressionHandler) {
        ((DefaultWebSecurityExpressionHandler) bean).setDefaultRolePrefix(null);
    }
    if (bean instanceof SecurityContextHolderAwareRequestFilter) {
        SecurityContextHolderAwareRequestFilter filter = (SecurityContextHolderAwareRequestFilter) bean;
        filter.setRolePrefix(StringUtils.EMPTY);
        try {
            filter.afterPropertiesSet();
        } catch (ServletException e) {
            throw new FatalBeanException(e.getMessage(), e);
        }
    }

    return bean;
}

From source file:com.npower.dm.tracking.servlet.AccessTrackingFilter.java

public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) {
    try {/* w w  w .  j a v  a 2 s.c  om*/
        if (request instanceof HttpServletRequest) {
            HttpServletRequest req = (HttpServletRequest) request;
            this.tracker4Access.log(req);
        }
        filterChain.doFilter(request, response);
    } catch (ServletException sx) {
        filterConfig.getServletContext().log(sx.getMessage());
        log.error(sx.getMessage(), sx);
        log.error(sx.getMessage(), sx.getCause());
    } catch (Throwable ex) {
        filterConfig.getServletContext().log(ex.getMessage());
        log.error(ex.getMessage(), ex);
    } finally {
    }
}

From source file:net.sf.j2ep.test.PostTest.java

public void setUp() {
    proxyFilter = new ProxyFilter();

    config.setInitParameter("dataUrl", "/WEB-INF/classes/net/sf/j2ep/test/testData.xml");
    try {/*from   w  ww  .  j a  va2s  .  c o m*/
        proxyFilter.init(config);
    } catch (ServletException e) {
        fail("Problem with init, error given was " + e.getMessage());
    }
}

From source file:gov.nih.nci.cabig.caaers.web.AbstractAjaxFacade.java

/**
 * Build the HTML content for the AJAX call
 * *//*from   ww w.  j av  a2  s.co  m*/
protected String getOutputFromJsp(final String jspResource) {
    String html = "Error in rendering...";
    try {
        html = WebContextFactory.get().forwardToString(jspResource);
    } catch (ServletException e) {
        throw new CaaersSystemException(e.getMessage(), e);
    } catch (IOException e) {
        throw new CaaersSystemException(e.getMessage(), e);
    }
    return html;
}

From source file:org.craftercms.security.authorization.impl.AccessDeniedHandlerImpl.java

/**
 * Forwards the request to the error page (to preserve the browser URL).
 *//* w  w w.  j ava 2 s. co m*/
protected void forwardToErrorPage(RequestContext context) throws CrafterSecurityException, IOException {
    HttpServletRequest request = context.getRequest();
    HttpServletResponse response = context.getResponse();

    response.setStatus(HttpServletResponse.SC_FORBIDDEN);

    if (logger.isDebugEnabled()) {
        logger.debug("Forwarding to error page at " + errorPageUrl + ", with 403 FORBIDDEN status");
    }

    RequestDispatcher dispatcher = request.getRequestDispatcher(errorPageUrl);
    try {
        dispatcher.forward(request, response);
    } catch (ServletException e) {
        throw new CrafterSecurityException(e.getMessage(), e);
    }
}

From source file:be.fedict.hsm.admin.webapp.security.AuthenticationController.java

public String logout() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    HttpServletRequest httpServletRequest = (HttpServletRequest) externalContext.getRequest();
    try {/*from  w  w w  . j av a  2  s .  co  m*/
        httpServletRequest.logout();
    } catch (ServletException e) {
        LOG.error("logout error: " + e.getMessage(), e);
    }
    return "/index.xhtml";
}

From source file:org.megatome.frame2.front.TestMissingCommonsValidation.java

private HttpFrontController initializeServlet() {
    HttpFrontController servlet = getServlet();
    try {//from w ww.  j av a 2s .co m
        servlet.init();
    } catch (ServletException e) {
        fail("Unexpected ServletException: " + e.getMessage()); //$NON-NLS-1$
    }
    Configuration config = getServlet().getConfiguration();

    assertNotNull(config);

    this.request.setServletPath("http://localhost/validateEvent.f2"); //$NON-NLS-1$

    return servlet;
}

From source file:de.mare.mobile.ui.jsf.pages.LoginPage.java

/**
 * Perform login of the user/*w w  w. j  ava2  s  .  co  m*/
 * 
 */
public String loginAction() {

    FacesContext context = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
    try {
        request.login(this.username, this.password);
        String username = request.getUserPrincipal().getName();
        User currentUser = userRepository.findUser(username);
        userSession.setUser(currentUser);
        LOG.info("username is: " + username);
    } catch (ServletException e) {
        if (StringUtils.contains(e.getMessage(), "User already logged in")) {
            String username = request.getUserPrincipal().getName();
            User currentUser = userRepository.findUser(username);
            userSession.setUser(currentUser);
            LOG.info("User already loggedn in");
            LOG.info("username is: " + username);
        } else {
            context.addMessage(null, new FacesMessage("Login failed."));
            return "login.error";
        }

    }
    return "portal.start";
}

From source file:gov.nih.nci.cabig.caaers.web.admin.ImportAjaxFacade.java

private String getOutputFromJsp(final String jspResource) {
    String html = "Error in rendering...";
    try {//from   w  w  w . j  a  va 2 s. co  m
        html = WebContextFactory.get().forwardToString(jspResource);
    } catch (ServletException e) {
        throw new CaaersSystemException(e.getMessage(), e);
    } catch (IOException e) {
        throw new CaaersSystemException(e.getMessage(), e);
    }
    return html;
}

From source file:com.jaspersoft.jasperserver.api.security.externalAuth.cas.JSSoapProcessingFilter.java

protected void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url)
        throws IOException {
    try {//from ww  w .  ja  v a 2 s  .  c  o m
        chain.doFilter(request, response);
    }

    catch (ServletException e) {
        logger.error("ServletException: " + e.getMessage());
        throw new IllegalStateException(e);
    }
}