@Override public String viewBotUI(Deployment.Environment environment, String botId, String language, String location, String uiIdentifier, String targetDevice) { try { if (environment != Deployment.Environment.unrestricted && httpServletRequest.getRemoteUser() == null) { httpServletRequest.authenticate(httpServletResponse); return null; } return null; } catch (IOException e) { log.error(e.getLocalizedMessage(), e); throw new InternalServerErrorException(e.getLocalizedMessage(), e); } catch (ServletException e) { throw new InternalServerErrorException(e.getLocalizedMessage(), e); } }
request.logout(); } catch (ServletException e) { LOGGER.fine(e.getLocalizedMessage());
private static String locate(String path) { try { if (path.startsWith("~./")) { path = Servlets.locate(ServletFns.getCurrentServletContext(), ServletFns.getCurrentRequest(), ClassWebResource.PATH_PREFIX + path.substring(2), Locators.getDefault()); return path; } return Servlets.locate(ServletFns.getCurrentServletContext(), ServletFns.getCurrentRequest(), path, null); } catch (ServletException ex) { log(ex.getLocalizedMessage()); } return path; }
LOG.info(e.getLocalizedMessage());
authentication = null; } catch (ServletException e) { LOGGER.fine(e.getLocalizedMessage());
LOG.info(e.getLocalizedMessage());
@Test(expected = ServletException.class) public void invalidSwitcherModeInitParameter() throws Exception { SiteSwitcherRequestFilter filter = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "xyz"); try { filter.init(filterConfig); } catch (ServletException ex) { assertEquals("Invalid switcherMode init parameter", ex.getLocalizedMessage()); throw ex; } }
@Test(expected = ServletException.class) public void missingServerNameInitParameter() throws Exception { SiteSwitcherRequestFilter filter = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "mDot"); try { filter.init(filterConfig); } catch (ServletException ex) { assertEquals("serverName init parameter not found", ex.getLocalizedMessage()); throw ex; } }