Package org.strecks.controller.chain.command

Source Code of org.strecks.controller.chain.command.Preprocess

package org.strecks.controller.chain.command;

import org.apache.struts.chain.commands.ActionCommandBase;
import org.apache.struts.chain.contexts.ActionContext;
import org.apache.struts.chain.contexts.ServletActionContext;
import org.strecks.preprocess.RequestPreprocessor;
import org.strecks.preprocess.SessionErrorPreprocessor;

/**
* Added to chain as a pre-process command
* @author Phil Zoio
*/
public class Preprocess extends ActionCommandBase
{

  private RequestPreprocessor preProcessor;

  public Preprocess()
  {
    super();
    preProcessor = newRequestPreprocessor();
  }

  protected RequestPreprocessor newRequestPreprocessor()
  {
    return new SessionErrorPreprocessor();
  }

  @Override
  public boolean execute(ActionContext context) throws Exception
  {
    ServletActionContext sc = (ServletActionContext) context;
    preProcessor.preprocessRequest(sc.getRequest());
    return false;
  }

}
TOP

Related Classes of org.strecks.controller.chain.command.Preprocess

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.