public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (request instanceof HttpServletRequest) { HttpServletRequest reg = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; final Session sess = WebManager.getSession(_config.getServletContext(), (HttpServletRequest) request); String path = Https.getThisPathInfo(request); if (path == null) { path = Https.getThisServletPath(request); } try { final Object old = I18Ns.setup(sess, request, response, sess.getWebApp().getConfiguration().getResponseCharset()); try { if (process(sess, reg, resp, path, true)) return; // done } catch (Throwable ex) { // pass } finally { I18Ns.cleanup(request, old); } } finally { SessionsCtrl.requestExit(sess); } } chain.doFilter(request, response); }
} finally { I18Ns.cleanup(httpreq, old); SessionsCtrl.requestExit(sess); SessionsCtrl.setCurrent((Session) null);
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String path = Https.getThisPathInfo(request); final boolean bRichlet = path != null && path.length() > 0; if (!bRichlet) path = Https.getThisServletPath(request); // if (log.finerable()) log.finer("Creates from "+path); final Session sess = WebManager.getSession(getServletContext(), request); if (!SessionsCtrl.requestEnter(sess)) { response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, Messages.get(MZk.TOO_MANY_REQUESTS)); return; } try { final Object old = I18Ns.setup(sess, request, response, sess.getWebApp().getConfiguration().getResponseCharset()); try { if (!process(sess, request, response, path, bRichlet)) handleError(sess, request, response, path, null); } catch (Throwable ex) { handleError(sess, request, response, path, ex); } finally { I18Ns.cleanup(request, old); } } finally { SessionsCtrl.requestExit(sess); } }
SessionsCtrl.requestExit(sess); SessionsCtrl.setCurrent((Session) null);