Package com.opensymphony.module.sitemesh

Examples of com.opensymphony.module.sitemesh.Config


    public void init(ServletConfig servletConfig) throws ServletException {
        super.init(servletConfig);

        this.servletConfig = servletConfig;
        factory = Factory.getInstance(new Config(servletConfig));

        servletConfig.getServletContext().setAttribute("webwork.servlet", this);

        //Initialize VelocityEngine@VelocityManager
        VelocityManager.getInstance().init(getServletContext());
View Full Code Here


        this.filterConfig = filterConfig;
        super.init(filterConfig);
        ServletContext sc = filterConfig.getServletContext();
        Factory instance = (Factory) sc.getAttribute(SITEMESH_FACTORY);
        if (instance == null) {
            sc.setAttribute(SITEMESH_FACTORY, new StrutsSiteMeshFactory(new Config(filterConfig)));
        }
    }
View Full Code Here

            sc.setAttribute(SITEMESH_FACTORY, new StrutsSiteMeshFactory(new Config(filterConfig)));
        }
    }

    protected DecoratorSelector initDecoratorSelector(SiteMeshWebAppContext webAppContext) {
        Factory factory = Factory.getInstance(new Config(filterConfig));
        factory.refresh();
        return new FreemarkerMapper2DecoratorSelector(factory.getDecoratorMapper());
    }
View Full Code Here

        super.init(filterConfig);
     }

    protected DecoratorSelector initDecoratorSelector(SiteMeshWebAppContext webAppContext) {
        // TODO: Remove heavy coupling on horrible SM2 Factory
        Factory factory = Factory.getInstance(new Config(filterConfig));
        factory.refresh();
        return new FreemarkerMapper2DecoratorSelector(factory.getDecoratorMapper());
    }
View Full Code Here

            @Override
            public String getFilterName() {
                return null;
            }
        };
        Config config = new Config(filterConfig);
        Grails5535Factory sitemeshFactory = new Grails5535Factory(config);
        if(servletContext != null) {
            servletContext.setAttribute(FACTORY_SERVLET_CONTEXT_ATTRIBUTE, sitemeshFactory);
        }
        sitemeshFactory.refresh();
View Full Code Here

        MockHttpServletRequest request = (MockHttpServletRequest)webRequest.getCurrentRequest();
        request.setMethod("GET");
        request.setRequestURI("orders/list");
        ServletContext context = webRequest.getServletContext();
        GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
        Config c = new Config(new MockServletConfig(context));
        m.init(c, null, null);
        HTMLPageParser parser = new HTMLPageParser();
        String html = "<html><head><title>Test title</title><meta name=\"layout\" content=\"test\"></meta></head><body>here is the body</body></html>";

        Page page = parser.parse(html.toCharArray());
View Full Code Here

        request.setRequestURI("/");

        ServletContext context = webRequest.getServletContext();

        GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
        Config c = new Config(new MockServletConfig(context));
        m.init(c, null, null);
        HTMLPageParser parser = new HTMLPageParser();
        String html = "<html><head><title>Foo title</title></head><body>here is the body</body></html>";

        Page page = parser.parse(html.toCharArray());
View Full Code Here

                "def actionUri = '/foo/fooAction'\n" +
        "}").newInstance();

        request.setAttribute(GrailsApplicationAttributes.CONTROLLER, controller);
        GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
        Config c = new Config(new MockServletConfig(context));
        m.init(c, null, null);
        HTMLPageParser parser = new HTMLPageParser();
        String html = "<html><head><title>Foo title</title></head><body>here is the body</body></html>";

        Page page = parser.parse(html.toCharArray());
View Full Code Here

                    "def actionUri = '/foo/fooAction'\n" +
            "}").newInstance();

            request.setAttribute(GrailsApplicationAttributes.CONTROLLER, controller);
            GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
            Config c = new Config(new MockServletConfig(context));
            m.init(c, null, null);
            HTMLPageParser parser = new HTMLPageParser();
            String html = "<html><head><title>Foo title</title></head><body>here is the body</body></html>";

            Page page = parser.parse(html.toCharArray());
View Full Code Here

                "def actionUri = '/test/testAction'\n" +
        "}").newInstance();

        request.setAttribute(GrailsApplicationAttributes.CONTROLLER, controller);
        GrailsLayoutDecoratorMapper m = new GrailsLayoutDecoratorMapper();
        Config c = new Config(new MockServletConfig(context));
        m.init(c, null, null);
        HTMLPageParser parser = new HTMLPageParser();
        String html = "<html><head><title>Test title</title></head><body>here is the body</body></html>";

        Page page = parser.parse(html.toCharArray());
View Full Code Here

TOP

Related Classes of com.opensymphony.module.sitemesh.Config

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.