/** * <p>Create and return an <code>ActionForm</code> instance appropriate to * the information in this <code>FormBeanConfig</code>.</p> * <p><b>NOTE:</b> If the given <code>ActionContext</code> is not of type * <code>ServletActionContext</code> (or a subclass), then the form which * is returned will have a null <code>servlet</code> property. Some of * the subclasses of <code>ActionForm</code> included in Struts will later * throw a <code>NullPointerException</code> in this case. </p> <p>TODO: * Find a way to control this direct dependency on the Servlet API.</p> * * @param context The ActionContext. * @return ActionForm instance * @throws IllegalAccessException if the Class or the appropriate * constructor is not accessible * @throws InstantiationException if this Class represents an abstract * class, an array class, a primitive type, * or void; or if instantiation fails for * some other reason */ public ActionForm createActionForm(ActionContext context) throws IllegalAccessException, InstantiationException { ActionServlet actionServlet = null; if (context instanceof ServletActionContext) { ServletActionContext saContext = (ServletActionContext) context; actionServlet = saContext.getActionServlet(); } return createActionForm(actionServlet); }
actionForm = formConfig.createActionForm(servlet); } catch (IllegalAccessException e) { log.error(e.getMessage(), e);
instance = config.createActionForm(servlet); if (log.isDebugEnabled()) { log.debug(
instance = config.createActionForm(servlet);
ActionForm form = formBeanConfig.createActionForm(this);
instance = formBeanConfig.createActionForm(actionCtx);