Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call an action defined within another package

 
John Louis
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

In struts2 you can use "namespace" for call another package action and also get new URL type.

So use namespace.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic