This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Redirect and xml

 
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.
 
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 ]
 
Author and all-around good cowpoke
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
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic