Package org.mojavemvc.initialization

Examples of org.mojavemvc.initialization.AppProperties


    @Test
    public void handleError() throws Exception {

        String errorJsp = "error.jsp";
       
        AppProperties properties = mock(AppProperties.class);
        when(properties.getProperty(DefaultJSPErrorHandler.JSP_ERROR_FILE))
            .thenReturn(errorJsp);

        ErrorHandler errorHandler = new DefaultJSPErrorHandler();
        View view = errorHandler.handleError(null, properties);
View Full Code Here


        return injector;
    }
   
    private AppProperties newAppProperties() {
       
        return new AppProperties() {
            @Override
            public Object getProperty(String name) {
                return null;
            }
        };
View Full Code Here

        ErrorHandlerFactory errorHandlerFactory = (ErrorHandlerFactory) ctx.getAttribute(ErrorHandlerFactory.KEY);
        ErrorHandler errorHandler = errorHandlerFactory.createErrorHandler();

        Injector injector = (Injector) ctx.getAttribute(GuiceInitializer.KEY);
        AppProperties properties = (AppProperties) ctx.getAttribute(AppProperties.KEY);

        ServletResourceModule.set(req, res);

        View view;
        try {
View Full Code Here

        try {

            Set<Class<? extends Module>> moduleClasses = scanModuleClasses();
            Set<Module> providedModules = getModulesFromProvider();
            AppProperties appProps = new DefaultAppProperties();
            context.setAttribute(AppProperties.KEY, appProps);
            GuiceInitializer guiceInitializer =
                    new GuiceInitializer(moduleClasses, providedModules, appProps);
            Injector injector = guiceInitializer.initializeInjector();
            context.setAttribute(GuiceInitializer.KEY, injector);
View Full Code Here

        String errorHandlerFactory = config.getInitParameter(ERROR_HANDLER_FACTORY);
        if (isEmpty(errorHandlerFactory)) {

            logger.debug("no " + ERROR_HANDLER_FACTORY + " init-param specified, using default...");
           
            AppProperties properties = (AppProperties)context.getAttribute(AppProperties.KEY);
            String defaultErrorHandlerFactory = (String)properties.getProperty(ErrorHandlerFactory.DEFAULT_FACTORY);
            if (isEmpty(defaultErrorHandlerFactory)) {
                defaultErrorHandlerFactory = DefaultErrorHandlerFactory.class.getName();
            }
           
            errorHandlerFactory = defaultErrorHandlerFactory;
View Full Code Here

TOP

Related Classes of org.mojavemvc.initialization.AppProperties

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.