| Author |
Call an action defined within another package
|
John Louis
Greenhorn
Joined: Aug 14, 2008
Posts: 10
|
|
I need to call an action defined in struts.xml within another package (one that is different from the package under which the currently executed action is in). I am now inside the jsp page directed to from action1 inside package1. From this jsp page I set the action url to "action2" but this action 2 is in package 2. When I submit the form I get a message which says /package1/action2 not defined. Can some1 help me out with this?
|
 |
Tom Rispoli
Ranch Hand
Joined: Aug 29, 2008
Posts: 349
|
|
I haven't done what your trying to do before but I think your problem is that when are calling action2 you are specifying the name space for package1. I think if you direct you url to the namespace specified for package2 this will work. Displaying the relevand parts of your jsp and struts.xml file as well as the error message might help.
|
 |
Nishan Patel
Ranch Hand
Joined: Sep 07, 2008
Posts: 676
|
|
hi.. In struts2 you can use "namespace" for call another package action and also get new URL type. So use namespace.
|
Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
|
 |
 |
|
|
subject: Call an action defined within another package
|
|
|