Package org.apache.struts.config

Examples of org.apache.struts.config.ControllerConfig


        moduleConfig3 = factoryObject.createModuleConfig("/3");

        context.setAttribute(Globals.MODULE_KEY + "/3", moduleConfig3);

        // Instantiate the controller configuration for this app
        ControllerConfig controller = new ControllerConfig();
        moduleConfig3.setControllerConfig(controller);

        // Configure the properties we will be testing
        controller.setForwardPattern("/forwarding$M$P");
        controller.setInputForward(true);
        controller.setPagePattern("/paging$M$P");

        // Configure global forward declarations
        moduleConfig3.addForwardConfig
            (new ForwardConfig("moduleForward",
                               "/module/forward",
View Full Code Here


     */
    protected void initRequestProcessorClass(ModuleConfig config)
        throws ServletException {
           
        String tilesProcessorClassname = TilesRequestProcessor.class.getName();
        ControllerConfig ctrlConfig = config.getControllerConfig();
        String configProcessorClassname = ctrlConfig.getProcessorClass();

        // Check if specified classname exist
        Class configProcessorClass;
        try {
            configProcessorClass =
                RequestUtils.applicationClass(configProcessorClassname);
               
        } catch (ClassNotFoundException ex) {
            log.fatal(
                "Can't set TilesRequestProcessor: bad class name '"
                    + configProcessorClassname
                    + "'.");
            throw new ServletException(ex);
        }

        // Check if it is the default request processor or Tiles one.
        // If true, replace by Tiles' one.
        if (configProcessorClassname.equals(RequestProcessor.class.getName())
            || configProcessorClassname.endsWith(tilesProcessorClassname)) {
               
            ctrlConfig.setProcessorClass(tilesProcessorClassname);
            return;
        }

        // Check if specified request processor is compatible with Tiles.
        Class tilesProcessorClass = TilesRequestProcessor.class;
View Full Code Here

     * @deprecated Will be removed in a release after Struts 1.1.
     */
    private void defaultControllerConfig(ModuleConfig config) {

        String value = null;
        ControllerConfig cc = config.getControllerConfig();
       
        value = getServletConfig().getInitParameter("bufferSize");
        if (value != null) {
            cc.setBufferSize(Integer.parseInt(value));
        }
       
        value = getServletConfig().getInitParameter("content");
        if (value != null) {
            cc.setContentType(value);
        }
       
        value = getServletConfig().getInitParameter("locale");       
        // must check for null here
        if (value != null) {
            if ("true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)) {
                cc.setLocale(true);
            } else {
                cc.setLocale(false);
            }
        }
       
        value = getServletConfig().getInitParameter("maxFileSize");
        if (value != null) {
            cc.setMaxFileSize(value);
        }
       
        value = getServletConfig().getInitParameter("nocache");
        if (value != null) {
            if ("true".equalsIgnoreCase(value) || "yes".equalsIgnoreCase(value)) {
                cc.setNocache(true);
            } else {
                cc.setNocache(false);
            }
        }
       
        value = getServletConfig().getInitParameter("multipartClass");
        if (value != null) {
            cc.setMultipartClass(value);
        }
       
        value = getServletConfig().getInitParameter("tempDir");
        if (value != null) {
            cc.setTempDir(value);
        }

    }
View Full Code Here

     * @throws ServletException On errors.
     */
    protected void initRequestProcessorClass(ModuleConfig config) throws ServletException
    {
    String tilesProcessorClassname = TilesRequestProcessor.class.getName();
    ControllerConfig ctrlConfig = config.getControllerConfig();
    String configProcessorClassname = ctrlConfig.getProcessorClass();

      // Check if specified classname exist
    Class configProcessorClass;
    try
     {
     configProcessorClass = RequestUtils.applicationClass( configProcessorClassname);
     }
    catch(java.lang.ClassNotFoundException ex)
     {
     log.fatal( "Can't set TilesRequestProcessor: bad class name '"
                + configProcessorClassname
                + "'.");
     throw new ServletException(ex);
     }

      // Check if it is the default request processor or Tiles one.
      // If true, replace by Tiles' one.
    if(configProcessorClassname.equals(RequestProcessor.class.getName())
        || configProcessorClassname.endsWith(tilesProcessorClassname))
      {
      ctrlConfig.setProcessorClass(tilesProcessorClassname);
      return;
      }

      // Check if specified request processor is compatible with Tiles.
    Class tilesProcessorClass = TilesRequestProcessor.class;
View Full Code Here

    /**
     * The controller configuration object for this module.
     */
    public ControllerConfig getControllerConfig() {
        if (this.controllerConfig == null) {
            this.controllerConfig = new ControllerConfig();
        }
        return (this.controllerConfig);
    }
View Full Code Here

        appConfig3 = new ApplicationConfig("/3");
        context.setAttribute(Globals.MODULE_KEY + "/3", appConfig3);

        // Instantiate the controller configuration for this app
        ControllerConfig controller = new ControllerConfig();
        appConfig3.setControllerConfig(controller);

        // Configure the properties we will be testing
        controller.setForwardPattern("/forwarding$M$P");
        controller.setInputForward(true);
        controller.setPagePattern("/paging$M$P");

        // Configure global forward declarations
        appConfig3.addForwardConfig
            (new ForwardConfig("moduleForward",
                               "/module/forward",
View Full Code Here

    /**
     * <p>The controller configuration object for this module.</p>
     */
    public ControllerConfig getControllerConfig() {
        if (this.controllerConfig == null) {
            this.controllerConfig = new ControllerConfig();
        }

        return (this.controllerConfig);
    }
View Full Code Here

            + moduleConfig.getPrefix() + "'");
        super.init(servlet, moduleConfig);

        initCatalogFactory(servlet, moduleConfig);

        ControllerConfig controllerConfig = moduleConfig.getControllerConfig();

        String catalogName = controllerConfig.getCatalog();

        catalog = this.catalogFactory.getCatalog(catalogName);

        if (catalog == null) {
            throw new ServletException("Cannot find catalog '" + catalogName
                + "'");
        }

        String commandName = controllerConfig.getCommand();

        command = catalog.getCommand(commandName);

        if (command == null) {
            throw new ServletException("Cannot find command '" + commandName
                + "'");
        }

        this.setActionContextClassName(controllerConfig.getProperty(
                ACTION_CONTEXT_CLASS));
    }
View Full Code Here

     */
    protected void initRequestProcessorClass(ModuleConfig config)
        throws ServletException {

        String tilesProcessorClassname = TilesRequestProcessor.class.getName();
        ControllerConfig ctrlConfig = config.getControllerConfig();
        String configProcessorClassname = ctrlConfig.getProcessorClass();

        // Check if specified classname exist
        Class configProcessorClass;
        try {
            configProcessorClass =
                RequestUtils.applicationClass(configProcessorClassname);

        } catch (ClassNotFoundException ex) {
            log.fatal(
                "Can't set TilesRequestProcessor: bad class name '"
                    + configProcessorClassname
                    + "'.");
            throw new ServletException(ex);
        }

        // Check to see if request processor uses struts-chain.  If so,
        // no need to replace the request processor.
        if (ComposableRequestProcessor.class.isAssignableFrom(configProcessorClass)) {
            return;
        }

        // Check if it is the default request processor or Tiles one.
        // If true, replace by Tiles' one.
        if (configProcessorClassname.equals(RequestProcessor.class.getName())
            || configProcessorClassname.endsWith(tilesProcessorClassname)) {

            ctrlConfig.setProcessorClass(tilesProcessorClassname);
            return;
        }

        // Check if specified request processor is compatible with Tiles.
        Class tilesProcessorClass = TilesRequestProcessor.class;
View Full Code Here

        moduleConfig3 = factoryObject.createModuleConfig("/3");

        context.setAttribute(Globals.MODULE_KEY + "/3", moduleConfig3);

        // Instantiate the controller configuration for this app
        ControllerConfig controller = new ControllerConfig();

        moduleConfig3.setControllerConfig(controller);

        // Configure the properties we will be testing
        controller.setForwardPattern("/forwarding$M$P");
        controller.setInputForward(true);
        controller.setPagePattern("/paging$M$P");

        // Configure global forward declarations
        moduleConfig3.addForwardConfig(new ForwardConfig("moduleForward",
                "/module/forward", false)); // No redirect, same module
View Full Code Here

TOP

Related Classes of org.apache.struts.config.ControllerConfig

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.