File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLConnection and Java HttpSession's

 
Kyle Willkomm
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to make a connection over the web to a java application that maintains a session. It seems that using the URLConnection class you must instantiate it with the URL you want to hit. In doing so each new URL you hit the server with seems to get assigned a new session id defferent from the previos. And so I can not find a way to hit the java web application with several requests in a row that are treated as coming from the same session.
 
anandh
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been nagged by exactly the same question. Any inputs from gurus appreciated!
 
Kyle Willkomm
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found a solution that works for Tomcat Servlet Engine. It should work for all app servers and servlet engines that implement cookies to set their session id's. You simply parse out the cookie from your first request and submit is back with all subsequent requests. give me an e-mail and I'll send you the code. kyle.w.willkomm@accenture.com
 
anandh
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Kyle,
I just sent you an email. Hope to get a reply soon!
Thanks much.
 
Kyle Willkomm
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is apparently a open source solution to this problem at the jakarta.apache.org site. The HTTPClient they have in the Jakarta Commons area contains this functionality.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic