@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Constants.ENCODE); response.setContentType("application/json;charset=" + Constants.ENCODE); try { chain.doFilter(request, response); } catch (IOException ioe) { defaultLog.debug("Filter catch exception, " + ioe.toString(), ioe); throw ioe; } catch (ServletException se) { defaultLog.debug("Filter catch exception, " + se.toString(), se); throw se; } }
@Override protected RemoteInvocationResult doExecuteRequest( HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws IOException, ClassNotFoundException { assertEquals("http://myurl", config.getServiceUrl()); MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader("Compression", "gzip"); MockHttpServletResponse response = new MockHttpServletResponse(); request.setContent(baos.toByteArray()); try { exporter.handleRequest(request, response); } catch (ServletException ex) { throw new IOException(ex.toString()); } return readRemoteInvocationResult( new ByteArrayInputStream(response.getContentAsByteArray()), config.getCodebaseUrl()); } @Override
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(Constants.ENCODE); response.setContentType("application/json;charset=" + Constants.ENCODE); try { chain.doFilter(request, response); } catch (IOException ioe) { defaultLog.debug("Filter catch exception, " + ioe.toString(), ioe); throw ioe; } catch (ServletException se) { defaultLog.debug("Filter catch exception, " + se.toString(), se); throw se; } }
public void render(Content content, SiteMeshContext context) { SiteMeshWebAppContext webAppContext = (SiteMeshWebAppContext) context; try { render(content, webAppContext.getRequest(), webAppContext.getResponse(), webAppContext.getServletContext(), webAppContext); } catch (IOException e) { // TODO: Decent exception handling throw new RuntimeException(e.toString()); } catch (ServletException e) { // TODO: Decent exception handling throw new RuntimeException(e.toString()); } } }
log.error("Error building combined cached servlet data: " + request.getRequestURI() + " - " + e.toString(), e); throw e;
/** * Here the actual authentication has to be implemented.<br/> * <br/> * */ @Override protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { // default implementation authentications via servlet API (container managed) ServletRequestAttributes currentRequestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpServletRequest request = currentRequestAttributes.getRequest(); String login = authentication.getName(); String password = null; Object credentials = authentication.getCredentials(); if (credentials != null) { password = credentials.toString(); } try { request.login(login, password); } catch (ServletException e) { LOG.warn("Authentication failed: {}", e.toString()); throw new BadCredentialsException("Authentication failed.", e); } authentication.setDetails(userDetails); }
/** * Here the actual authentication has to be implemented.<br/> * <br/> * */ @Override protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { // default implementation authentications via servlet API (container managed) ServletRequestAttributes currentRequestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpServletRequest request = currentRequestAttributes.getRequest(); String login = authentication.getName(); String password = null; Object credentials = authentication.getCredentials(); if (credentials != null) { password = credentials.toString(); } try { request.login(login, password); } catch (ServletException e) { LOG.warn("Authentication failed: {}", e.toString()); throw new BadCredentialsException("Authentication failed.", e); } authentication.setDetails(userDetails); }
private void doLocking(ITransaction transaction, HttpServletRequest req, HttpServletResponse resp) throws IOException { // Tests if LockObject on requested path exists, and if so, tests // exclusivity LockedObject lo = _resourceLocks.getLockedObjectByPath(transaction, _path); if (lo != null) { if (lo.isExclusive()) { sendLockFailError(transaction, req, resp); return; } } try { // Thats the locking itself executeLock(transaction, req, resp); } catch (ServletException e) { resp.sendError(WebdavStatus.SC_INTERNAL_SERVER_ERROR); LOG.trace(e.toString()); } catch (LockFailedException e) { sendLockFailError(transaction, req, resp); } finally { lo = null; } }
private void doLocking( ITransaction transaction, HttpServletRequest req, HttpServletResponse resp ) throws IOException { // Tests if LockObject on requested path exists, and if so, tests // exclusivity LockedObject lo = resourceLocks.getLockedObjectByPath(transaction, path); if (lo != null) { if (lo.isExclusive()) { sendLockFailError(req, resp); return; } } try { // Thats the locking itself executeLock(transaction, req, resp); } catch (ServletException e) { resp.sendError(WebdavStatus.SC_INTERNAL_SERVER_ERROR); logger.trace(e.toString()); } catch (LockFailedException e) { sendLockFailError(req, resp); } finally { lo = null; } }
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;
ex=se.toString()+":"+se.getCause(); throw se;