You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Geoff Apps <ge...@bigpond.com> on 2003/05/19 04:41:26 UTC

Struts configuration via api

I am trying to add to the struts configuration file programatically inside a
plugin.

The following plugin code compiles and runs,

    public void init(ActionServlet action, ModuleConfig config)
    {
    	actionConfig = new ActionConfig();
    	actionConfig.setPath("/Login");
    	actionConfig.setType("com.support.struts.security.LoginAction");
    	actionConfig.setValidate(false);
	config.addActionConfig(actionConfig);
    }

however, the path /Login is not recognised at runtime. Does anyone have any
ideas on this ???

I am trying to avoid the need to add mappings like the following to every
struts-config file for each application we build.

    <action-mappings>
        <action 
            path="/Login"
            type="com.support.struts.security.LoginAction"
            validate="false"/>
	   ....
	   ....	
         ....
    </action-mappings>
	
My idea was to extend what is defined in the struts-config file for each
application with action mappings that are common. This makes our job a
little easier, and ensures that important areas like security are handled
consistently.

Perhaps there is a better way ???

Cheers,

Geoff Apps

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Struts configuration via api

Posted by Geoff Apps <ge...@bigpond.com>.
I am trying to add to the struts configuration file programatically inside a
plugin.

The following plugin code compiles and runs,

    public void init(ActionServlet action, ModuleConfig config)
    {
    	actionConfig = new ActionConfig();
    	actionConfig.setPath("/Login");
    	actionConfig.setType("com.support.struts.security.LoginAction");
    	actionConfig.setValidate(false);
	config.addActionConfig(actionConfig);
    }

however, the path /Login is not recognised at runtime. Does anyone have any
ideas on this ???

I am trying to avoid the need to add mappings like the following to every
struts-config file for each application we build.

    <action-mappings>
        <action 
            path="/Login"
            type="com.support.struts.security.LoginAction"
            validate="false"/>
	   ....
	   ....	
         ....
    </action-mappings>
	
My idea was to extend what is defined in the struts-config file for each
application with action mappings that are common. This makes our job a
little easier, and ensures that important areas like security are handled
consistently.

Perhaps there is a better way ???

Cheers,

Geoff Apps



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org