apps/example1/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java [34:78]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class ForwardCommand implements Command<String, Object, ServletWebContext<String, Object>> {

    private Log log = LogFactory.getLog(ForwardCommand.class);

    private String forward;

    /**
     * Return the uri to forward to.
     *
     * @return The uri to forward to
     */
    public String getForward() {
        return forward;
    }

    /**
     * Set the uri to forward to.
     *
     * @param forward The uri to forward to
     */
    public void setForward(String forward) {
        this.forward = forward;
    }

    /**
     * <p>Execute the command.</p>
     *
     * @param context The {@link Context} we are operating on
     * @return {@link Processing#CONTINUE} so that processing will continue.
     */
    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;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



apps/example2/src/main/java/org/apache/commons/chain2/apps/example/ForwardCommand.java [33:78]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class ForwardCommand implements Command<String, Object, ServletWebContext<String, Object>> {

    private Log log = LogFactory.getLog(ForwardCommand.class);

    private String forward;

    /**
     * Return the uri to forward to.
     *
     * @return The uri to forward to
     */
    public String getForward() {
        return forward;
    }

    /**
     * Set the uri to forward to.
     *
     * @param forward The uri to forward to
     */
    public void setForward(String forward) {
        this.forward = forward;
    }

    /**
     * <p>Execute the command.</p>
     *
     *
     * @param context The {@link org.apache.commons.chain2.Context} we are operating on
     * @return {@link Processing#CONTINUE} so that processnig will continue.
     */
    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;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



