Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does WebStart support sessions?

Status
Not open for further replies.

Strannik

Programmer
Jul 4, 2002
132
0
0
UA
Does WebStart support sessions?

I build request to servlet using URL connection. When servlet processes request it creates some internal data and put it into HttpServletRequest object, for example:

request.getSession(true).setAttribute(SERVLET_ID,String.valueOf(id));

But I notice that the next time servlet processes request the value of SERVLET_ID attribute is null.
When I used applet/servlet communication it didn't occur. What is the problem ??
 
Neither Webstart nor applets support HttpSession objects- because an HttpSession object is created by the servlet container (ie tomcat).
 
OK.

So when I make request to servlet(through WebStart) it creates new session each time ?
 
The rules for tomcat allocating NEW sessions are :

- If browser cookies are enabled, if there is no cookie named JSESSIONID present.
- If cookies are disabled, the container rewrites a URL of the form : If the JSESSIONID part is not present, a new session is allocated.

Some browsers or programs that connect to a web resource (ie a program running in webstart) do not understand how to accept either cookies, or URL rewriting - and hence the servlet container will think a new session should be allocated. Which I am guessing is your problem ...
 
OK. Thanks
I had to implement my own "sessions" ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top