Tabnine Logo
ServletException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
javax.servlet.ServletException

Best Java code snippets using javax.servlet.ServletException.getMessage (Showing top 20 results out of 846)

origin: spring-projects/spring-framework

/**
 * Return the detail message, including the message from the nested exception
 * if there is one.
 */
@Override
@Nullable
public String getMessage() {
  return NestedExceptionUtils.buildMessage(super.getMessage(), getCause());
}
origin: org.springframework/spring-web

/**
 * Return the detail message, including the message from the nested exception
 * if there is one.
 */
@Override
@Nullable
public String getMessage() {
  return NestedExceptionUtils.buildMessage(super.getMessage(), getCause());
}
origin: BroadleafCommerce/BroadleafCommerce

  @Override
  public void doFilterInternal(HttpServletRequest baseRequest, HttpServletResponse baseResponse, FilterChain chain) throws IOException, ServletException {
    try {
      super.doFilterInternal(baseRequest, baseResponse, chain);
    } catch (ServletException e) {
      if (e.getCause() instanceof StaleStateServiceException) {
        LOG.debug("Stale state detected", e);
        baseResponse.setStatus(HttpServletResponse.SC_CONFLICT);
        baseResponse.getWriter().write("Stale State Detected\n");
        baseResponse.getWriter().write(e.getMessage() + "\n");
      } else if (e.getCause() instanceof ServiceException) {
        //if authentication is null and CSRF token is invalid, must be session time out
        if (SecurityContextHolder.getContext().getAuthentication() == null && failureHandler != null) {
          baseRequest.setAttribute("sessionTimeout", true);
          failureHandler.onAuthenticationFailure(baseRequest, baseResponse, new SessionAuthenticationException("Session Time Out"));
        } else {
          throw e;
        }
      } else {
        throw e;
      }
    }
  }
}
origin: azkaban/azkaban

 ret.put("error", e.getMessage());
} catch (final ScheduleManagerException e) {
 logger.error(e.getMessage(), e);
origin: org.freemarker/freemarker

  pageContext.handlePageException(e);
} catch (ServletException e2) {
  throw new JspException(e2.getMessage());
} catch (IOException e2) {
  throw new JspException(e2.getMessage());
origin: spring-projects/spring-framework

@Test
public void notAuthorized() throws Exception {
  MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/locale.do");
  request.addPreferredLocale(Locale.CANADA);
  MockHttpServletResponse response = new MockHttpServletResponse();
  try {
    complexDispatcherServlet.service(request, response);
    assertTrue("Correct response", response.getStatus() == HttpServletResponse.SC_FORBIDDEN);
  }
  catch (ServletException ex) {
    fail("Should not have thrown ServletException: " + ex.getMessage());
  }
}
origin: spring-projects/spring-framework

@Test
public void modelAndViewDefiningException() throws Exception {
  MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/locale.do");
  request.addPreferredLocale(Locale.CANADA);
  request.addUserRole("role1");
  request.addParameter("fail", "yes");
  MockHttpServletResponse response = new MockHttpServletResponse();
  try {
    complexDispatcherServlet.service(request, response);
    assertEquals(200, response.getStatus());
    assertTrue("forwarded to failed", "failed1.jsp".equals(response.getForwardedUrl()));
  }
  catch (ServletException ex) {
    fail("Should not have thrown ServletException: " + ex.getMessage());
  }
}
origin: spring-projects/spring-framework

@Test
public void notDetectAllViewResolvers() throws ServletException, IOException {
  DispatcherServlet complexDispatcherServlet = new DispatcherServlet();
  complexDispatcherServlet.setContextClass(ComplexWebApplicationContext.class);
  complexDispatcherServlet.setNamespace("test");
  complexDispatcherServlet.setDetectAllViewResolvers(false);
  complexDispatcherServlet.init(new MockServletConfig(getServletContext(), "complex"));
  MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/unknown.do");
  MockHttpServletResponse response = new MockHttpServletResponse();
  try {
    complexDispatcherServlet.service(request, response);
    fail("Should have thrown ServletException");
  }
  catch (ServletException ex) {
    // expected
    assertTrue(ex.getMessage().contains("failed0"));
  }
}
origin: spring-projects/spring-framework

@Test
public void notDetectAllHandlerExceptionResolvers() throws ServletException, IOException {
  DispatcherServlet complexDispatcherServlet = new DispatcherServlet();
  complexDispatcherServlet.setContextClass(ComplexWebApplicationContext.class);
  complexDispatcherServlet.setNamespace("test");
  complexDispatcherServlet.setDetectAllHandlerExceptionResolvers(false);
  complexDispatcherServlet.init(new MockServletConfig(getServletContext(), "complex"));
  MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/unknown.do");
  MockHttpServletResponse response = new MockHttpServletResponse();
  try {
    complexDispatcherServlet.service(request, response);
    fail("Should have thrown ServletException");
  }
  catch (ServletException ex) {
    // expected
    assertTrue(ex.getMessage().contains("No adapter for handler"));
  }
}
origin: spring-projects/spring-framework

@Test
public void themeChangeInterceptor2() throws Exception {
  MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/locale.do");
  request.addPreferredLocale(Locale.CANADA);
  request.addUserRole("role1");
  request.addParameter("theme", "mytheme");
  request.addParameter("theme2", "theme");
  MockHttpServletResponse response = new MockHttpServletResponse();
  try {
    complexDispatcherServlet.service(request, response);
    assertTrue("Not forwarded", response.getForwardedUrl() == null);
  }
  catch (ServletException ex) {
    fail("Should not have thrown ServletException: " + ex.getMessage());
  }
}
origin: org.apache.cxf/cxf-rt-frontend-jaxws

public void setServletConfig(ServletConfig servletConfig) {
  try {
    shadowCxfServlet = (Servlet)servletClass.newInstance();
  } catch (InstantiationException | IllegalAccessException e) {
    throw new RuntimeException(e);
  }
  try {
    shadowCxfServlet.init(servletConfig);
  } catch (ServletException ex) {
    throw new RuntimeException(ex.getMessage(), ex);
  }
}
origin: spring-projects/spring-framework

assertEquals("test", ex.getMessage());
origin: org.apache.cxf/cxf-rt-transports-http

  serviceListGenerator.init(servletConfig);
} catch (ServletException e) {
  throw new RuntimeException(e.getMessage(), e);
origin: haraldk/TwelveMonkeys

@Test
public void testFilterMultiple() {
  final GenericFilterImpl filter = new GenericFilterImpl();
  try {
    filter.init(makeFilterConfig());
  }
  catch (ServletException e) {
    fail(e.getMessage());
  }
  FilterChain chain = new MyFilterChain(new Filter[] {
      filter, filter, filter, filter, filter
  });
  try {
    chain.doFilter(makeRequest(), makeResponse());
  }
  catch (IOException e) {
    fail(e.getMessage());
  }
  catch (ServletException e) {
    fail(e.getMessage());
  }
  assertEquals("Filter was invoked not invoked five times!", 5, filter.invocationCount);
  filter.destroy();
}
origin: haraldk/TwelveMonkeys

@Test
public void testInit() {
  Filter filter = makeFilter();
  try {
    filter.init(makeFilterConfig());
  }
  catch (ServletException e) {
    assertNotNull(e.getMessage());
  }
  finally {
    filter.destroy();
  }
}
origin: haraldk/TwelveMonkeys

@Test
public void testFilterOnlyOnce() {
  final GenericFilterImpl filter = new GenericFilterImpl();
  filter.setOncePerRequest(true);
  try {
    filter.init(makeFilterConfig());
  }
  catch (ServletException e) {
    fail(e.getMessage());
  }
  FilterChain chain = new MyFilterChain(new Filter[] {filter, filter, filter});
  try {
    chain.doFilter(makeRequest(), makeResponse());
  }
  catch (IOException e) {
    fail(e.getMessage());
  }
  catch (ServletException e) {
    fail(e.getMessage());
  }
  assertEquals("Filter was invoked more than once!", 1, filter.invocationCount);
  filter.destroy();
}
origin: haraldk/TwelveMonkeys

fail(e.getMessage());
fail(e.getMessage());
fail(e.getMessage());
origin: apache/cxf

public void setServletConfig(ServletConfig servletConfig) {
  try {
    shadowCxfServlet = (Servlet)servletClass.newInstance();
  } catch (InstantiationException | IllegalAccessException e) {
    throw new RuntimeException(e);
  }
  try {
    shadowCxfServlet.init(servletConfig);
  } catch (ServletException ex) {
    throw new RuntimeException(ex.getMessage(), ex);
  }
}
origin: stormpath/stormpath-sdk-java

public FilterChainManager stormpathFilterChainManager() {
  DefaultFilterChainManager mgr = new DefaultFilterChainManager(servletContext);
  try {
    addRoutes(mgr);
    return mgr;
  } catch (ServletException e) {
    String msg = "Could not create Filter Chain Manager: " + e.getMessage();
    throw new BeanCreationException(msg, e);
  }
}
origin: org.jboss.eap/wildfly-rts

protected void deployServlet(final DeploymentInfo deploymentInfo) {
  DeploymentManager manager = ServletContainer.Factory.newInstance().addDeployment(deploymentInfo);
  manager.deploy();
  deployment = manager.getDeployment();
  try {
    injectedHost.getValue().registerDeployment(deployment, manager.start());
  } catch (ServletException e) {
    RTSLogger.ROOT_LOGGER.warn(e.getMessage(), e);
    deployment = null;
  }
}
javax.servletServletExceptiongetMessage

Popular methods of ServletException

  • <init>
    Constructs a new servlet exception when the servlet needs to throw an exception and include a messag
  • getRootCause
    Returns the exception that caused this servlet exception.
  • getCause
  • printStackTrace
  • toString
  • initCause
  • getLocalizedMessage
  • getStackTrace
  • setStackTrace
  • addSuppressed

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • setContentView (Activity)
  • setScale (BigDecimal)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • JButton (javax.swing)
  • JTable (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now