Get your CodeRanch badge!*
The moose likes Sockets and Internet Protocols and the fly likes multiple connections with URLConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "multiple connections with URLConnection" Watch "multiple connections with URLConnection" New topic
Author

multiple connections with URLConnection

Kavita Ghia
Ranch Hand

Joined: Oct 10, 2000
Posts: 91
Hi,
I am trying to make multiple connections using URLConnection class.I have 2 servlets with which i get connected thru my Java application.I am able to connect to the first servlet correctly and i can send and receive data.Now depending on some checking i send the data retreived from my first servlet to the second servlet.So agin i make connection to the secons servlet URL.But i am facing the problems here. I cannot connect to second servlet in the tomcat server i see null value has been received.
This second servlet is not getting invoked.
Any Comments!!!

Also please tell me is it possible to make multiple connection using URLConnecton class or u can make only one connection???

Thanks in advance,
Kavita
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
why don't you use getServletContext().getRequestDispatcher(address).forward(request,response) or include(request,response)
it is easier.
Kavita Ghia
Ranch Hand

Joined: Oct 10, 2000
Posts: 91
Hello Eser,
I am processing the data in my java application and after that i am invoking the second servlet which is used to populate my bean.So that it becomes easy for me to retreive the value in jsp.
Can u tell where and how do i use getServletContext().getRequestDispatcher(address).forward(request,response) or include(request,response).
Thanks,
Kavita
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: multiple connections with URLConnection
 
Similar Threads
HttpURLConnection and MultpartResponse Servlet
Multiple message connections problem
pass object btw applet and servelt Part1
JavaMail Connections
Connectivity to External System