Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLConnection doesn't work in the JSP  RSS feed

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i'm having a problem in using URLConnection object.
i have two jsps. con1.jsp, con2.jsp and i want to make a url connection to con2.jsp from con1.jsp and print all the responses of con2.jsp in con1.jsp...
here is my code,

but the problem is, i have two webservers-
myserver1: iPlanet 4.1 SP7
myserver2: iPlanet 4.1 SP6
these two jsps works fine on myserver1 but they don't work on myserver2.
i observed that on myserver2 it doesn't go beyond conn.getInputStream(); statement at all. why so??
i also observed that the JSP engines on both of them are different as when i see the corresponding .java servlet code generated in backend for the jsps , it is different on both the servers for the same jsp...
any help would be appreciated...
regards
maulin.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
???
nobody has any idea? if i'm unclear please let me know.
one more detail,
myserver1 uses jdk1.2
myserver2 uses jdk1.3
regards
maulin
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this sounds weird but - try doing the setDoOutput call first, and you might also try with setDoOutput( true );
Bill
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi William,
actually i tried that but no help
i'm not really stuck with this as my final destination server (myserver3) executes this fine but i was just curious to know more about WebServers differences and wieredness (even if they are all same breed - iPlanet4.1- but with different SPs you know)...
i read somewhere that it is due to the blocking of getInputStream() call to the URLCOnnection and that some socket level thing is going wrong in some webservers (or may be its mis-behaving)...
anyways...when i will learn webserver implementation of jsps/servlets i might solve it for me :-)
regards
maulin.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!