Пример #1
0
  /**
   * Builds {@link ActionRequest} and invokes it. If action result is a chain, it repeats the
   * process.
   */
  public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
      throws IOException, ServletException {
    HttpServletRequest request = (HttpServletRequest) req;
    HttpServletResponse response = (HttpServletResponse) res;

    String actionPath = DispatcherUtil.getServletPath(request);
    try {
      actionPath = madvocController.invoke(actionPath, request, response);
    } catch (Exception ex) {
      log.error("Exception while invoking action path: " + actionPath, ex);
      ex.printStackTrace();
      throw new ServletException(ex);
    }
    if (actionPath != null) { // action path is not consumed
      actionPath = processUnhandledPath(actionPath, req, res);
      if (actionPath != null) {
        chain.doFilter(request, response);
      }
    }
  }
Пример #2
0
 @Override
 protected void redirect(HttpServletRequest request, HttpServletResponse response, String path)
     throws IOException {
   DispatcherUtil.redirectPermanent(request, response, path);
 }