Search code examples
javastruts-1

get request parameters in struts-config.xml in struts1


In my action I would like to redirect to completely new application, I have configured my action as below in struts-config.xml

 <action path="/nameSpace/Myaction" type="MyActionClass" name="MyForm">
   <forward name="success" path="hereIwanttosendDynamic" redirect="true" />

 </action>

as you can see in above configuration I want to redirect to new application, And that application URL will be defined in my Action Class.

Now my doubt is Can I use EL in Struts-config.xml so that I can keep my new application URL in request and I would like to get that in struts-config.xml Something like below

path="${redirectURL}"

Solution

  • No, you can't.

    The S1 config file is read at startup and does not store expressions that can be evaluated later.

    But there's no reason to; redirect from the action.