Package com.sun.bookstore2.dispatcher

Examples of com.sun.bookstore2.dispatcher.Dispatcher


                    + getConfigPath());
        }
    }

    protected Dispatcher initDispatcher(Map<String, String> params) {
        Dispatcher du = new Dispatcher(servletContext, params);
        du.init();
        Dispatcher.setInstance(du);
        ValueStack stack = ((ValueStackFactory) du.getContainer().getInstance(
                ValueStackFactory.class)).createValueStack();
        stack.getContext().put(
                "com.opensymphony.xwork2.ActionContext.container",
                du.getContainer());
        ActionContext.setContext(new ActionContext(stack.getContext()));
        configurationManager = du.getConfigurationManager();
        configuration = configurationManager.getConfiguration();
        container = configuration.getContainer();
        return du;
    }
View Full Code Here


            dispatcherInitParams.put("config", "struts-default.xml," + getConfigPath());
        }
    }

    protected Dispatcher initDispatcher(Map<String, String> params) {
        Dispatcher du = new Dispatcher(servletContext, params);
        du.init();
        Dispatcher.setInstance(du);
        ValueStack stack = ((ValueStackFactory) du.getContainer().getInstance(ValueStackFactory.class)).createValueStack();
        stack.getContext().put("com.opensymphony.xwork2.ActionContext.container", du.getContainer());
        ActionContext.setContext(new ActionContext(stack.getContext()));
        configurationManager = du.getConfigurationManager();
        configuration = configurationManager.getConfiguration();
        container = configuration.getContainer();
        return du;
    }
View Full Code Here

            processAnnotations(currentlyExecutingTest.getMethodName());
            if (StringUtils.isNotBlank(getConfigPath())) {
                dispatcherInitParams = new HashMap<String, String>();
                dispatcherInitParams.put("config", "struts-default.xml," + getConfigPath());
            }
            Dispatcher dispatcher = StrutsTestCaseHelper.initDispatcher(servletContext, dispatcherInitParams);
            configurationManager = dispatcher.getConfigurationManager();
            configuration = configurationManager.getConfiguration();
            container = configuration.getContainer();
            actionProxyFactory = ((ActionProxyFactory) container.getInstance(ActionProxyFactory.class));
        }
        super.configuration = configuration;
View Full Code Here

            dispatcherInitParams.put("config", "struts-default.xml," + getConfigPath());
        }
    }

    protected Dispatcher initDispatcher(Map<String, String> params) {
        Dispatcher du = new Dispatcher(servletContext, params);
        du.init();
        Dispatcher.setInstance(du);
        ValueStack stack = ((ValueStackFactory) du.getContainer().getInstance(ValueStackFactory.class)).createValueStack();
        stack.getContext().put("com.opensymphony.xwork2.ActionContext.container", du.getContainer());
        ActionContext.setContext(new ActionContext(stack.getContext()));
        configurationManager = du.getConfigurationManager();
        configuration = configurationManager.getConfiguration();
        container = configuration.getContainer();
        return du;
    }
View Full Code Here

            dispatcherInitParams.put("config", "struts-default.xml," + getConfigPath());
        }
    }

    protected Dispatcher initDispatcher(Map<String, String> params) {
        Dispatcher du = new Dispatcher(servletContext, params);
        du.init();
        Dispatcher.setInstance(du);
        ValueStack stack = ((ValueStackFactory) du.getContainer().getInstance(ValueStackFactory.class)).createValueStack();
        stack.getContext().put("com.opensymphony.xwork2.ActionContext.container", du.getContainer());
        ActionContext.setContext(new ActionContext(stack.getContext()));
        configurationManager = du.getConfigurationManager();
        configuration = configurationManager.getConfiguration();
        container = configuration.getContainer();
        return du;
    }
View Full Code Here

  /**
   * Creates and initializes the dispatcher
   */
  public Dispatcher initDispatcher(HostConfig filterConfig) {
    Dispatcher dispatcher = createDispatcher(filterConfig);
    dispatcher.init();
    return dispatcher;
  }
View Full Code Here

   *
   * @throws IllegalStateException
   *             If there is no dispatcher available
   */
  public Dispatcher findDispatcherOnThread() {
    Dispatcher dispatcher = Dispatcher.getInstance();
    if (dispatcher == null) {
      throw new IllegalStateException(
          "Must have the StrutsPrepareFilter execute before this one");
    }
    return dispatcher;
View Full Code Here

        ValueStack stack = (ValueStack) req.getAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY);

        if (stack == null) {

            HttpServletResponse res = (HttpServletResponse) pageContext.getResponse();
            Dispatcher du = Dispatcher.getInstance();
            if (du == null) {
                throw new ConfigurationException("The Struts dispatcher cannot be found.  This is usually caused by "+
                        "using Struts tags without the associated filter. Struts tags are only usable when the request "+
                        "has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag.");
            }
            stack = du.getContainer().getInstance(ValueStackFactory.class).createValueStack();
            Map extraContext = du.createContextMap(new RequestMap(req),
                    req.getParameterMap(),
                    new SessionMap(req),
                    new ApplicationMap(pageContext.getServletContext()),
                    req,
                    res,
View Full Code Here

            params = requestParams;
        }
        Map requestMap = new RequestMap(req);
        Map session = new SessionMap(req);
        Map application = new ApplicationMap(servletContext);
        Dispatcher du = Dispatcher.getInstance();
        HashMap ctx = du.createContextMap(requestMap,
                params,
                session,
                application,
                req,
                res,
                servletContext);

        try {
            ActionMapper actionMapper = du.getContainer().getInstance(ActionMapper.class);
            ActionMapping mapping = actionMapper.getMappingFromActionName(action);
            ActionInvocation inv = new ValidatorActionInvocation(ctx, true);
            ActionProxyFactory actionProxyFactory = du.getContainer().getInstance(ActionProxyFactory.class);
            ActionProxy proxy = actionProxyFactory.createActionProxy(inv, namespace, mapping.getName(), mapping.getMethod(), true, true);
            proxy.execute();
            Object a = proxy.getAction();

            if (a instanceof ValidationAware) {
View Full Code Here

        pageContext.setResponse(response);
        pageContext.setJspWriter(jspWriter);
        pageContext.setServletContext(servletContext);

        mockContainer = new Mock(Container.class);
        Dispatcher du = new Dispatcher(pageContext.getServletContext(), new HashMap());
        du.init();
        Dispatcher.setInstance(du);
        du.setConfigurationManager(configurationManager);
        session = new SessionMap(request);
        Map extraContext = du.createContextMap(new RequestMap(request),
                request.getParameterMap(),
                session,
                new ApplicationMap(pageContext.getServletContext()),
                request,
                response,
View Full Code Here

TOP

Related Classes of com.sun.bookstore2.dispatcher.Dispatcher

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.