• 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

Capturing Servlet Output

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic