Package org.g4studio.core.mvc.xstruts.action

Examples of org.g4studio.core.mvc.xstruts.action.ActionForm


      obj = getDynaActionFormClass().newInstance();
    } else {
      obj = formBeanClass().newInstance();
    }

    ActionForm form = null;

    if (obj instanceof ActionForm) {
      form = (ActionForm) obj;
    } else {
      form = new BeanValidatorForm(obj);
    }

    form.setServlet(servlet);

    if (form instanceof DynaBean && ((DynaBean) form).getDynaClass() instanceof MutableDynaClass) {
      DynaBean dynaBean = (DynaBean) form;
      MutableDynaClass dynaClass = (MutableDynaClass) dynaBean.getDynaClass();
View Full Code Here


   */
  public ActionForm findOrCreateActionForm(String formName, String scopeName, ModuleConfig moduleConfig)
      throws IllegalAccessException, InstantiationException {
    Map scope = this.getScope(scopeName);

    ActionForm instance;
    FormBeanConfig formBeanConfig = moduleConfig.findFormBeanConfig(formName);

    if (formBeanConfig == null) {
      throw new IllegalArgumentException("No form config found under " + formName + " in module "
          + moduleConfig.getPrefix());
    }

    instance = (ActionForm) scope.get(formName);

    // ISSUE: Can we recycle the existing instance (if any)?
    if (instance != null) {
      getLogger().trace("Found an instance in scope " + scopeName + "; test for reusability");

      if (formBeanConfig.canReuse(instance)) {
        return instance;
      }
    }

    ActionForm form = formBeanConfig.createActionForm(this);

    // ISSUE: Should we check this call to put?
    scope.put(formName, form);

    return form;
View Full Code Here

    if (attribute == null) {
      return (null);
    }

    // Look up the existing form bean, if any
    ActionForm instance;

    if ("request".equals(mapping.getScope())) {
      instance = (ActionForm) this.request.getAttribute(attribute);
    } else {
      instance = (ActionForm) this.session.getAttribute(attribute);
View Full Code Here

      log.warn("No FormBeanConfig found under '" + name + "'");

      return (null);
    }

    ActionForm instance = lookupActionForm(request, attribute, mapping.getScope());

    // Can we recycle the existing form bean instance (if there is one)?
    if ((instance != null) && config.canReuse(instance)) {
      return (instance);
    }
View Full Code Here

    if (log.isDebugEnabled()) {
      log.debug(" Looking for ActionForm bean instance in scope '" + scope + "' under attribute key '"
          + attribute + "'");
    }

    ActionForm instance = null;
    HttpSession session = null;

    if ("request".equals(scope)) {
      instance = (ActionForm) request.getAttribute(attribute);
    } else {
View Full Code Here

  public static ActionForm createActionForm(FormBeanConfig config, ActionServlet servlet) {
    if (config == null) {
      return (null);
    }

    ActionForm instance = null;

    // Create and return a new form bean instance
    try {
      instance = config.createActionForm(servlet);
View Full Code Here

  public boolean execute(ActionContext actionCtx) throws Exception {
    // Set form valid until found otherwise
    actionCtx.setFormValid(Boolean.TRUE);

    // Is there a form bean for this request?
    ActionForm actionForm = actionCtx.getActionForm();

    if (actionForm == null) {
      return false;
    }
View Full Code Here

  // ------------------------------------------------------- Protected Methods
  protected ForwardConfig handle(ActionContext context, Exception exception, ExceptionConfig exceptionConfig,
      ActionConfig actionConfig, ModuleConfig moduleConfig) throws Exception {
    // Look up the remaining properties needed for this handler
    ServletActionContext sacontext = (ServletActionContext) context;
    ActionForm actionForm = (ActionForm) sacontext.getActionForm();
    HttpServletRequest request = sacontext.getRequest();
    HttpServletResponse response = sacontext.getResponse();

    // Handle this exception
    org.g4studio.core.mvc.xstruts.action.ExceptionHandler handler = (org.g4studio.core.mvc.xstruts.action.ExceptionHandler) ClassUtils
View Full Code Here

      return (false);
    }

    Map scope = actionCtx.getScope(actionConfig.getScope());

    ActionForm instance;

    instance = (ActionForm) scope.get(actionConfig.getAttribute());

    // Can we recycle the existing instance (if any)?
    if (!formBeanConfig.canReuse(instance)) {
      instance = formBeanConfig.createActionForm(actionCtx);
    }

    // TODO: Remove ServletActionContext when ActionForm no longer
    // directly depends on ActionServlet
    if (actionCtx instanceof ServletActionContext) {
      // The servlet property of ActionForm is transient, so
      // ActionForms which are restored from a serialized state
      // need to have their servlet restored.
      ServletActionContext sac = (ServletActionContext) actionCtx;

      instance.setServlet(sac.getActionServlet());
    }

    actionCtx.setActionForm(instance);

    scope.put(actionConfig.getAttribute(), instance);
View Full Code Here

    if (action == null) {
      return (false);
    }

    ActionConfig actionConfig = actionCtx.getActionConfig();
    ActionForm actionForm = actionCtx.getActionForm();

    // Execute the Action for this request, caching returned ActionForward
    ForwardConfig forwardConfig = execute(actionCtx, action, actionConfig, actionForm);

    actionCtx.setForwardConfig(forwardConfig);
View Full Code Here

TOP

Related Classes of org.g4studio.core.mvc.xstruts.action.ActionForm

Copyright © 2018 www.massapicom. 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.