Examples of TilesContextFactory


Examples of org.apache.tiles.context.TilesContextFactory

public class StrutsTilesContainerFactory extends TilesContainerFactory {


    @Override
    protected void storeContainerDependencies(Object context, Map<String, String> initParameters, Map<String, String> configuration, BasicTilesContainer container) throws TilesException {
        TilesContextFactory contextFactory =
            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);

        contextFactory = new StrutsTilesContextFactory(contextFactory);

        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);

        PreparerFactory prepFactory =
            (PreparerFactory) createFactory(configuration,
                PREPARER_FACTORY_INIT_PARAM);

        contextFactory.init(configuration);
        TilesApplicationContext tilesContext =
            contextFactory.createApplicationContext(context);

        container.setDefinitionsFactory(defsFactory);
        container.setContextFactory(contextFactory);
        container.setPreparerFactory(prepFactory);
        container.setApplicationContext(tilesContext);
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

     */
    protected void storeContainerDependencies(Object context,
                                              Map<String, String> initParameters,
                                              Map<String, String> configuration,
                                              BasicTilesContainer container) throws TilesException {
        TilesContextFactory contextFactory =
            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);

        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);

        PreparerFactory prepFactory =
            (PreparerFactory) createFactory(configuration,
                PREPARER_FACTORY_INIT_PARAM);

        contextFactory.init(configuration);
        TilesApplicationContext tilesContext =
            contextFactory.createApplicationContext(context);

        container.setDefinitionsFactory(defsFactory);
        container.setContextFactory(contextFactory);
        container.setPreparerFactory(prepFactory);
        container.setApplicationContext(tilesContext);
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

public class StrutsTilesContainerFactory extends TilesContainerFactory {


    @Override
    protected void storeContainerDependencies(Object context, Map<String, String> initParameters, Map<String, String> configuration, BasicTilesContainer container) throws TilesException {
        TilesContextFactory contextFactory =
            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);

        contextFactory = new StrutsTilesContextFactory(contextFactory);

        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);

        PreparerFactory prepFactory =
            (PreparerFactory) createFactory(configuration,
                PREPARER_FACTORY_INIT_PARAM);

        contextFactory.init(configuration);
        TilesApplicationContext tilesContext =
            contextFactory.createApplicationContext(context);

        container.setDefinitionsFactory(defsFactory);
        container.setContextFactory(contextFactory);
        container.setPreparerFactory(prepFactory);
        container.setApplicationContext(tilesContext);
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

    protected void storeContainerDependencies(Object context,
                                              Map<String, String> initParameters,
                                              Map<String, String> configuration,
                                              BasicTilesContainer container) throws TilesException {
        TilesContextFactory contextFactory =
            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);

        DefinitionsFactory defsFactory =
            (DefinitionsFactory) createFactory(configuration,
                DEFINITIONS_FACTORY_INIT_PARAM);

        PreparerFactory prepFactory =
            (PreparerFactory) createFactory(configuration,
                PREPARER_FACTORY_INIT_PARAM);

        TilesApplicationContext tilesContext =
            contextFactory.createApplicationContext(context);

        container.setDefinitionsFactory(defsFactory);
        container.setContextFactory(contextFactory);
        container.setPreparerFactory(prepFactory);
        container.setApplicationContext(tilesContext);
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

    /** {@inheritDoc} */
    @Override
    public TilesContainer createContainer(Object context) {
        BasicTilesContainer container = instantiateContainer(context);
        TilesContextFactory contextFactory = createContextFactory(context);
        TilesApplicationContext applicationContext = contextFactory
                .createApplicationContext(context);
        container.setContextFactory(contextFactory);
        container.setApplicationContext(applicationContext);
        LocaleResolver resolver = createLocaleResolver(context,
                applicationContext, contextFactory);
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

     * @param className The name of the class to instantiate.
     * @param factories The list of factories to add to.
     */
    protected void registerContextFactory(String className,
            List<TilesContextFactory> factories) {
        TilesContextFactory retValue = null;
        try {
            Class<? extends TilesContextFactory> clazz = Class.forName(
                    className).asSubclass(TilesContextFactory.class);
            retValue = clazz.newInstance();
        } catch (ClassNotFoundException e) {
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

     * initialization.
     */
    protected void storeContainerDependencies(Object context,
            Map<String, String> initParameters,
            Map<String, String> configuration, BasicTilesContainer container) {
        TilesContextFactory contextFactory =
            (TilesContextFactory) createFactory(configuration,
                CONTEXT_FACTORY_INIT_PARAM);
        contextFactory.init(configuration);

        TilesApplicationContext tilesContext =
            contextFactory.createApplicationContext(context);

        RendererFactory rendererFactory =
            (RendererFactory) createFactory(configuration,
                RENDERER_FACTORY_INIT_PARAM);

View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

    @Override
    public void setUp() throws Exception {
        rendererFactory = new BasicRendererFactory();
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesContextFactory contextFactory = EasyMock
                .createMock(TilesContextFactory.class);
        TilesContainer container = EasyMock.createMock(TilesContainer.class);
        rendererFactory.setApplicationContext(applicationContext);
        rendererFactory.setContextFactory(contextFactory);
        rendererFactory.setContainer(container);
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

    /**
     * Tests
     * {@link AbstractBaseAttributeRenderer#setContextFactory(TilesContextFactory)}.
     */
    public void testSetContextFactory() {
        TilesContextFactory contextFactory = EasyMock
                .createMock(TilesContextFactory.class);
        EasyMock.replay(contextFactory);
        renderer.setContextFactory(contextFactory);
        assertNotNull("The context factory is null", renderer.contextFactory);
    }
View Full Code Here

Examples of org.apache.tiles.context.TilesContextFactory

    public void testRender() throws IOException {
        Attribute attribute = new Attribute();
        StringWriter writer = new StringWriter();
        TilesApplicationContext applicationContext = EasyMock
                .createMock(TilesApplicationContext.class);
        TilesContextFactory contextFactory = EasyMock
                .createMock(TilesContextFactory.class);
        TilesRequestContext requestContext = EasyMock
                .createMock(TilesRequestContext.class);
        EasyMock.expect(contextFactory.createRequestContext(applicationContext))
                .andReturn(requestContext);
        EasyMock.replay(applicationContext, contextFactory, requestContext);
        renderer.setApplicationContext(applicationContext);
        renderer.setContextFactory(contextFactory);
        renderer.render(attribute, writer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.