Package com.sun.bookstore2.dispatcher

Examples of com.sun.bookstore2.dispatcher.Dispatcher


        ServletContext servletContext = (ServletContext) ctx.get(ServletActionContext.SERVLET_CONTEXT);
        PageContext pageContext = (PageContext) ctx.get(ServletActionContext.PAGE_CONTEXT);
        Map session = ctx.getSession();
        Map application = ctx.getApplication();

        Dispatcher du = Dispatcher.getInstance();
        Map extraContext = du.createContextMap(new RequestMap(req),
                newParams,
                session,
                application,
                req,
                res,
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

  private Struts2() {
    //
  }

  public static String getConstant(final String name) {
    Dispatcher dispatcher = Dispatcher.getInstance();
    ConfigurationManager manager = dispatcher.getConfigurationManager();
    Configuration configuration = manager.getConfiguration();
    Container container = configuration.getContainer();
    String value = container.getInstance(String.class, name);
    return value;
  }
View Full Code Here

        if (stack == null) {
            stack = ValueStackFactory.getFactory().createValueStack();

            HttpServletResponse res = (HttpServletResponse) pageContext.getResponse();
            Dispatcher du = Dispatcher.getInstance();
            Map extraContext = du.createContextMap(new RequestMap(req),
                    req.getParameterMap(),
                    new SessionMap(req),
                    new ApplicationMap(pageContext.getServletContext()),
                    req,
                    res,
View Full Code Here

            String value = cfg.getInitParameter(name);
            params.put(name, value);
        }
       
        Dispatcher.setPortletSupportActive(true);
        dispatcherUtils = new Dispatcher(ServletContextHolderListener.getServletContext(), params);
        dispatcherUtils.init();
       
        // For testability
        if (factory == null) {
            factory = dispatcherUtils.getConfigurationManager().getConfiguration().getContainer().getInstance(ActionProxyFactory.class);
View Full Code Here

        super.setUp();
        initDispatcher(null);
    }
   
    protected Dispatcher initDispatcher(Map<String,String> params) {
        Dispatcher du = StrutsTestCaseHelper.initDispatcher(new MockServletContext(), params);
        configurationManager = du.getConfigurationManager();
        configuration = configurationManager.getConfiguration();
        container = configuration.getContainer();
        return du;
    }
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<String, Object> 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

        ServletContext servletContext = (ServletContext) ctx.get(ServletActionContext.SERVLET_CONTEXT);
        PageContext pageContext = (PageContext) ctx.get(ServletActionContext.PAGE_CONTEXT);
        Map session = ctx.getSession();
        Map application = ctx.getApplication();

        Dispatcher du = Dispatcher.getInstance();
        Map<String, Object> extraContext = du.createContextMap(new RequestMap(req),
                newParams,
                session,
                application,
                req,
                res,
View Full Code Here

            String name = (String) e.nextElement();
            String value = cfg.getInitParameter(name);
            params.put(name, value);
        }
       
        dispatcherUtils = new Dispatcher(new PortletServletContext(cfg.getPortletContext()), params);
        dispatcherUtils.init();
       
        // For testability
        if (factory == null) {
            factory = dispatcherUtils.getConfigurationManager().getConfiguration().getContainer().getInstance(ActionProxyFactory.class);
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

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.