Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple connections with URLConnection

 
Kavita Ghia
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't you use getServletContext().getRequestDispatcher(address).forward(request,response) or include(request,response)
it is easier.
 
Kavita Ghia
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic