my dog learned polymorphism*
The moose likes Servlets and the fly likes session tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "session tracking" Watch "session tracking" New topic
Author

session tracking

Sankar Subbiramaniam
Ranch Hand

Joined: Oct 03, 2000
Posts: 116
Hi,
I have my application hosted in webappcabaret.com. Till yesterday my application was working. suddenly it is not able to track sessions, between servlets.
My application: Login panel: If user enters proper userid, a session is created, then Main panel displayed. Main panel is static page consisting of frames. One of the frames has links to my applications. (url is hardcoded in the frames). On selecting my application, my other servlets get invoked. All of them use the sessions created in my Login Page for verification (This i have done so that a user cannot come to Main page with out logging).
Now all my applications fail, as no session is passed to them. I was told that urls need to be encoded. But since my URLs are in a static html, how do i do this ?
Please help.
regards sankar
Paul Wetzel
Ranch Hand

Joined: Nov 02, 1999
Posts: 107
check out the class java.net.URLEncoder. It has a static method to accomplish encodeing (URLEncoder.encode(String). If there are static you should still be a abel to do it:
String theLink = "www.javaranch.com?this=" + URLEncoder.encode("hello world") + "&that=" + URLEncoder.encode("good by world!")
best of luck
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Sankar,
How did you overcome this? Are all your sessions are now passed to other applications now?
regds
maha anna
Sankar Subbiramaniam
Ranch Hand

Joined: Oct 03, 2000
Posts: 116
Hi Maha,
I converted all my html files to JSP files and encoded all the URLs using (request.encodeURL()).
Now its working fine.
regards
sankar
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Sankar, I am having a similar session tracking problem with JSP's. Where did you put the request.encodeURL() within the JSP?
I tried just placing at the beginning but that did not work.
 
jQuery in Action, 2nd edition
 
subject: session tracking