package com.eb.common;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public abstract class AbstractAction extends Action{
private DC dc = null;
private Logger logger = Logger.getLogger(AbstractAction.class);
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,HttpServletRequest request,
HttpServletResponse response) throws Exception{
logger.debug("come into method execute()");
dc = new DC();
ActionForward nextpage=null;
nextpage = processExecute(actionMapping,(AbstractActionForm)actionForm,request,response,dc);
return nextpage;
}
/*
*
*/
private ActionForward processExecute(ActionMapping actionMapping,
AbstractActionForm form,HttpServletRequest request,
HttpServletResponse response,DC dc) throws Exception{
logger.debug("come into processExecute()");
String forward = (String)this.getClass().getMethod(request.getParameter( "do" ),new Class[] {
AbstractActionForm.class,
HttpServletRequest.class,
HttpServletResponse.class,
DC.class } ).invoke(this,new Object[] { form,
request,response,dc } );
return actionMapping.findForward(forward);
}
protected abstract AbstractVO Form2VO(AbstractActionForm form) throws Exception;
protected abstract AbstractActionForm VO2Form(AbstractVO vo) throws Exception;
protected abstract DC callEJB(DC dc) throws Exception;
}