Package org.apache.struts.config

Examples of org.apache.struts.config.ControllerConfig


    /**
     * 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


     */
    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");
        if (value != null) {
            if (value.equalsIgnoreCase("true") ||
                value.equalsIgnoreCase("yes")) {
                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 (value.equalsIgnoreCase("true") ||
                value.equalsIgnoreCase("yes")) {
                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 If an error occur
     */
    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

        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

  public static final String PARAM_CONFIG = "config";
 
  public void init(ActionServlet actionServlet, ModuleConfig moduleConfig)
      throws ServletException {

    ControllerConfig ctrlConfig = moduleConfig.getControllerConfig();
        ctrlConfig.setProcessorClass(XsltRequestProcessor.class.getName());
  }
View Full Code Here

        //
        if ( rp == null )
        {
            try
            {
                ControllerConfig cc = mc.getControllerConfig();
                rp = ( RequestProcessor ) RequestUtils.applicationInstance( cc.getProcessorClass() );
                rp.init( InternalUtils.getActionServlet( getServletContext() ), mc );
            }
            catch ( Exception e )
            {
                _log.error( "Could not initialize request processor for module " + mc.getPrefix(), e );
View Full Code Here

        ModuleConfig mc = InternalUtils.ensureModuleConfig( parentDir, getServletContext() );
        LinkedHashMap/*< String, SharedFlowController >*/ sharedFlows = getDefaultSharedFlows( context );

        if ( mc != null )
        {
            ControllerConfig cc = mc.getControllerConfig();

            if ( cc instanceof PageFlowControllerConfig )
            {
                Map/*< String, String >*/ sharedFlowTypes = ( ( PageFlowControllerConfig ) cc ).getSharedFlowTypes();

View Full Code Here

        initModulePlugIns( ac );
        ac.freeze();
        configDigester = null;

        // If this is a FlowController module, make a callback to the event reporter.
        ControllerConfig cc = ac.getControllerConfig();
        if ( cc instanceof PageFlowControllerConfig )
        {
            PageFlowControllerConfig pfcc = ( PageFlowControllerConfig ) cc;
            PageFlowEventReporter er = AdapterManager.getServletContainerAdapter( getServletContext() ).getEventReporter();
            er.flowControllerRegistered( modulePath, pfcc.getControllerClass(), ac );
View Full Code Here

            // Try to select the appropriate Struts module and delegate to its RequestProcessor.
            //
            ModuleConfig moduleConfig = InternalUtils.selectModule( modulePath, request, servletContext );
           
            // If this module came from an abstract page flow controller class, send an error.
            ControllerConfig cc = moduleConfig.getControllerConfig();
            if (cc instanceof PageFlowControllerConfig && ((PageFlowControllerConfig) cc).isAbstract()) {
                InternalUtils.sendDevTimeError( "PageFlow_AbstractPageFlow", null, HttpServletResponse.SC_NOT_FOUND,
                                                request, response, servletContext,
                                                new Object[]{ modulePath } );
                return;
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.