Question

I'm trying to call using action forward property in struts 1 from struts-config, and I would like to invoke another action, which it's located in another struts.config file. And obviously it doesn't work!

My code is:

In "struts-misExpedientes.xml" 
<action path="/s99bIrInicio" forward="$$$WEBROOT_ENVIRONMENT$$$/comunJSP/s99binicio.do">

the other xml file is "struts-comun.xml"
<action path="/s99binicio" forward="/s99bIrWelcomeMensajeDia.do" />

Notes: "WEBROOT_ENVIRONMENT" is a variable I have declared in a property file and its value is [http:// localhost:8100/s99bEnvironmentWar]

I thank any idea you could provided.

Was it helpful?

Solution

If you mean that you want to forward from one webapp to another webapp, then this is not possible. Every webapp is isolated from the other webapps. Each has its awn classes, libraries and sessions, different from the other one. So passing HttpRequest objects from one to the other doesn't make sense.

You should probably redirect to the other webapp. BTW, action chaining is discouraged by Struts, even when it's possible, inside a single wepapp.

EDIT: it appears that you're using modules. So do what the documentation says:

There are three approaches for switching from one module to another.

  • You can use the org.apache.struts.actions.SwitchAction from the Extras JAR,
  • you can use a <forward> (global or local) and specify the contextRelative attribute with a value of true,
  • or you can specify the "module" parameter as part of any of the Struts JSP hyperlink tags (Include, Img, Link, Rewrite, or Forward).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top