Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirect and xml  RSS feed

 
Stephen Bassoli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright, here is what I want accomplished. My servlet (servlet1) builds an XML string, stores it in the HttpServletRequest object, and needs to forward the HttpServletRequest to servlet2. Servlet2 is on another server, thus RequestDispatcher.forward is not an option. Servlet2 also only responds to doPost. Thus, resp.sendRedirect is not an option.
Servlet2's response is an XML file (xml2). How could I possibly, as an ideal end result, have xml2 stored in a string in servlet1.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you need to build a post request, with the generated XML as the POST body, and send it to the other server.
Whenever I need to build and send HTTP requests, or parse the returned results, I turn to HTTPUnit. This is a free tool, billed as a web application testing framework, which is actually really useful for any sort of remote-control of web applications.
[ February 06, 2004: Message edited by: Frank Carver ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another powerful free tool is HttpClient an Apache Sofware Foundation project. I have used it for load-testing servlet applications.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!