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

Capturing Servlet Output

 
Kelley Koszegi
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have 2 servlets, servlet A and B. Servlet A is creating a query-type screen which should allow a user to enter information into a form & submit it. The form calls the doGet method in Servlet B & the query is executed by B. B displays the output. My problem is that control has been shifted to servlet B. I don't want the user to 'know' about servlet B at all. I want servlet A to communicate the doPost & capture the resulting output, parse it nicely & display the output itself. The two servlets reside on two different servers. I don't own servlet B and have no knowledge of other methods in servlet B besides the doPost. Will RMI work if the doPost method has a void return value? Is chaining the method to try here (though I thought chaining is taboo)? Is there another commonly used method?
TIA,
--Kkoszegi
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to me you should be able to have servlet A open a URLConnection to servlet B to submit the form data and process the response.
Bill
 
Kelley Koszegi
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bill, I appreciate your response. While poking around yesterday I found references to this solution which I tried to implement. Unfortunately I could not get the parameters to the POST correctly. I finally found the answer on JGuru's site. Just in case anyone else is looking for how to correctly send parameters to a POST via a HttpUrlConnection, check out this posting at JGuru: http://www.jguru.com/forums/view.jsp?EID=470766
Thanks,
--KKoszegi
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic