This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
there are 3 ways to use servlet chaining: 1 is to use the : repsonse.sendRedirect("URL here"); thats causes the browser to redirect to the new url or in this case servlet. i think this is what u want. second involves forwarding the request and response to another servlet, but in this case you need to male sure the first servlet didnt produce any output or it wont work. request.getRequestDispatcher("URL here").forward(request,response); third is almost the same but you actually include the output of the second servlet in your first one:
Calling another servlet through URLConnection from a servlet is just like calling it from an applet or an application. I think there were some recent threads on communication from an applet to a servlet, search for those. Bukk
Joined: Aug 09, 2001
Hi All, Thank you very much for your reply. Now that I am not able to post the values from one servlet to another through https using URL connection and I also need to know whether I could redirect the response to another servlet. The reason is I could post the values to a servlet from normal java program through https using URL connection, but in this case also I am not able to redirect the response to another servlet. Could you help me in finding out the problem of posting the values one servlet to another through https using URL connection and redirecting the response too. Thanks in Advance, Nathan.
Author and all-around good cowpoke
Joined: Mar 22, 2000
You can certainly fake a POST - you just have to have the request headers and body content right. IMHO the best way to start is to trap the content of a normal POST from a browser so you can see what you have to send. I wrote a utility to snoop on browser request/server response data. There is a link to UtilSnoop download at the bottom of this page: http://www.lanw.com/books/javasoap/ Bill