Package org.apache.struts.action

Examples of org.apache.struts.action.Action


        if ((valid == null) || !valid.booleanValue()) {
            return (false);
        }

        // Acquire the resources we will need to send to the Action
        Action action = actionCtx.getAction();

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


            return (false);
        }

        // Create (if necessary) and cache an Action instance
        Action action = getAction(actionCtx, type, actionConfig);

        if (LOG.isTraceEnabled()) {
            LOG.trace("setting action to " + action);
        }
View Full Code Here

        if (actions == null) {
            actions = new HashMap();
            context.getApplicationScope().put(actionsKey, actions);
        }

        Action action = null;

        synchronized (actions) {
            action = (Action) actions.get(type);

            if (action == null) {
                log.info("Initialize action of type: " + type);
                action = (Action) ClassUtils.getApplicationInstance(type);
                actions.put(type, action);
            }
        }

        if (action.getServlet() == null) {
            ServletActionContext saContext = (ServletActionContext) context;
            ActionServlet actionServlet = saContext.getActionServlet();

            action.setServlet(actionServlet);
        }

        return (action);
    }
View Full Code Here

    }
   
    public String execute() throws Exception {
        ActionContext ctx = ActionContext.getContext();
        ActionConfig actionConfig = ctx.getActionInvocation().getProxy().getConfig();
        Action action = null;
        try {
            action = (Action) objectFactory.buildBean(className, null);
        } catch (Exception e) {
            throw new StrutsException("Unable to create the legacy Struts Action", e, actionConfig);
        }
       
        // We should call setServlet() here, but let's stub that out later
       
        Struts1Factory strutsFactory = new Struts1Factory(Dispatcher.getInstance().getConfigurationManager().getConfiguration());
        ActionMapping mapping = strutsFactory.createActionMapping(actionConfig);
        HttpServletRequest request = ServletActionContext.getRequest();
        HttpServletResponse response = ServletActionContext.getResponse();
        ActionForward forward = action.execute(mapping, actionForm, request, response);
       
        ActionMessages messages = (ActionMessages) request.getAttribute(Globals.MESSAGE_KEY);
        if (messages != null) {
            for (Iterator i = messages.get(); i.hasNext(); ) {
                ActionMessage msg = (ActionMessage) i.next();
View Full Code Here

            assert fc != null : "no FlowController for request " + request.getRequestURI();
            assert fc.getClass().getName().equals( actionMapping.getParameter() )
                    : "current page flow  type " + fc.getClass().getName() + " does not match type specified in "
                      + FLOW_CONTROLLER_ACTION_CLASSNAME + ": " + actionMapping.getParameter();

            Action action = new FlowControllerAction( fc );
            action.setServlet( servlet );
            return action;
        }

        return super.processActionCreate( request, response, actionMapping );
    }
View Full Code Here

    private String scopeKey;
   
    public String execute() throws Exception {
        ActionContext ctx = ActionContext.getContext();
        ActionConfig actionConfig = ctx.getActionInvocation().getProxy().getConfig();
        Action action = null;
        try {
            action = (Action) ObjectFactory.getObjectFactory().buildBean(className, null);
        } catch (Exception e) {
            throw new StrutsException("Unable to create the legacy Struts Action", e, actionConfig);
        }
       
        // We should call setServlet() here, but let's stub that out later
       
        Struts1Factory strutsFactory = new Struts1Factory(Dispatcher.getInstance().getConfigurationManager().getConfiguration());
        ActionMapping mapping = strutsFactory.createActionMapping(actionConfig);
        HttpServletRequest request = ServletActionContext.getRequest();
        HttpServletResponse response = ServletActionContext.getResponse();
        ActionForward forward = action.execute(mapping, actionForm, request, response);
       
        ActionMessages messages = (ActionMessages) request.getAttribute(Globals.MESSAGE_KEY);
        if (messages != null) {
            for (Iterator i = messages.get(); i.hasNext(); ) {
                ActionMessage msg = (ActionMessage) i.next();
View Full Code Here

  @Override
  public ActionForward execute(
      ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
      throws Exception {

    Action delegateAction = getDelegateAction(mapping);
    return delegateAction.execute(mapping, form, request, response);
  }
View Full Code Here

  @Override
  protected Action processActionCreate(
      HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
      throws IOException {

    Action action = getDelegateAction(mapping);
    if (action != null) {
      return action;
    }
    return super.processActionCreate(request, response, mapping);
  }
View Full Code Here

  @Override
  protected Action processActionCreate(
      HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
      throws IOException {

    Action action = super.processActionCreate(request, response, mapping);
    getWebApplicationContext().getAutowireCapableBeanFactory().autowireBeanProperties(
        action, getAutowireMode(), getDependencyCheck());
    return action;
  }
View Full Code Here

  @Override
  protected Action processActionCreate(
      HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
      throws IOException {

    Action action = super.processActionCreate(request, response, mapping);
    getWebApplicationContext().getAutowireCapableBeanFactory().autowireBeanProperties(
        action, getAutowireMode(), getDependencyCheck());
    return action;
  }
View Full Code Here

TOP

Related Classes of org.apache.struts.action.Action

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.