This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to forward to another web service

 
Kim Kantola
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to forward to another web service from my action class, not from my jsp, and am not sure how to do this. What I want to do is when the user submits the page, they go to my action class, there, I collect data from the submitted form, put it into an object, put the object into the session, and then I want to go to a reports web service running on the same server which will pull the data from the session and do its thing.
I can't just hard code the url into struts config.xml because I determine it programatically as follows:



Any pointers?

Happy Fourth of July to all!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kim Kantola:
I want to forward to another web service from my action class
This, you can do. Just create a forward with the proper URL and return it. Example:

Originally posted by Kim Kantola:
What I want to do is when the user submits the page, they go to my action class, there, I collect data from the submitted form, put it into an object, put the object into the session, and then I want to go to a reports web service running on the same server which will pull the data from the session and do its thing.

This, you cannot do. The J2EE specification does not allow for an HttpSession to be shared between more than one web application even when they're hosted on the same server. The only way to pass information from one web application to another is through query string parameters (e.g. ?parm1=foo&parm2=bar).
[ July 03, 2007: Message edited by: Merrill Higginson ]
 
Kim Kantola
Ranch Hand
Posts: 276
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merrill, Thank you so much, this is a big big help.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic