public Processing execute()

in apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java [64:85]


    public Processing execute(ServletWebContext<String, Object> context) {
        try {
            String uri = getForward(context);
            if (uri != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Forwarding to " + uri);
                }
                RequestDispatcher rd = context.getContext().getRequestDispatcher(uri);
                rd.forward(context.getRequest(), context.getResponse());
                return Processing.FINISHED;
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("No forward found");
                }
                return Processing.CONTINUE;
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ServletException e) {
            throw new RuntimeException(e);
        }
    }