This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello All, I am establishing a connection between a JSP and a Servlet which are on 2 different web servers. The JSP invokes the Servlet using the URLConnection. Is there some way by which a parameter can be passed between these two components. I do not want to pass a paramter as a Object over an ObjectOutputStream because the current flow requires me to pass an existing object on the stream. Is there some method in URLConnection which i may have missed? Any suggestions ?!? Regards, Ashutosh S
If you are addressing the other servlet with "http://..." then what you really get is a java.net.HttpURLConnection. With that you can use addRequestProperty to add your own header to the request. This could be used to pass some simple properties - of course the other servlet would have to know to look for that header. Bill
Joined: Jun 07, 2001
Hello , Thanks William! I am posting the code here so that anyone having the same problem can use it for reference - JSP Code- URL url = new URL("http://192.x.x.x:yyyy/myServlet"); HttpURLConnection httpConn = (HttpURLConnection)url.openConnection(); httpConn.setRequestProperty("action","save");