• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Call an action defined within another package

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic