1 16 17 package org.apache.struts.chain.servlet; 18 19 20 import org.apache.commons.chain.Context; 21 import org.apache.commons.chain.web.servlet.ServletWebContext; 22 import org.apache.struts.Globals; 23 import org.apache.struts.action.ActionForm; 24 import org.apache.struts.action.ActionMapping; 25 import org.apache.struts.chain.AbstractPopulateActionForm; 26 import org.apache.struts.config.ActionConfig; 27 import org.apache.struts.util.RequestUtils; 28 import org.apache.commons.logging.Log; 29 import org.apache.commons.logging.LogFactory; 30 31 37 38 public class PopulateActionForm extends AbstractPopulateActionForm { 39 40 41 private static final Log log = LogFactory.getLog(PopulateActionForm.class); 42 43 45 46 protected void populate(Context context, 47 ActionConfig actionConfig, 48 ActionForm actionForm) throws Exception 49 { 50 ServletWebContext swcontext = (ServletWebContext) context; 51 RequestUtils.populate(actionForm, actionConfig.getPrefix(), actionConfig.getSuffix(), swcontext.getRequest()); 52 } 53 54 protected void reset(Context context, 55 ActionConfig actionConfig, 56 ActionForm actionForm) { 57 58 ServletWebContext swcontext = (ServletWebContext) context; 59 actionForm.reset((ActionMapping) actionConfig, swcontext.getRequest()); 60 61 if (actionConfig.getMultipartClass() != null) { 63 swcontext.getRequestScope().put(Globals.MULTIPART_KEY, 64 actionConfig.getMultipartClass()); 65 } 66 67 } 68 69 70 } 71 | Popular Tags |