aspose file tools*
The moose likes Servlets and the fly likes enforcing URL rewriting in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "enforcing URL rewriting in Tomcat" Watch "enforcing URL rewriting in Tomcat" New topic
Author

enforcing URL rewriting in Tomcat

Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
How can enforce URL rewriting in tomcat even if cookies are enabled?
When i set the cookies off in IE, URL rewriting works fine and each URL that i rewrite contains jsessionId. But if i set the cookies on, it is lost and URLs are not re-written and cookies are used for session maintence. Can I enforce this?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Why do you want URL rewriting when cookies are enabled? :roll:


Groovy
Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
this is because , the sessions of two users are getting mixed. Here is the post in which i had explained my problem...

Hi all,
We have developed an web application that is accessed by multiple users (say 1000) concurrently. It is developed using struts framework and entire session tracking is done using HttpSession object. Now the problem is -
- the application is opened in two sepearte browser instances on the same machine.
- Two different userIds are used to log in.
- After continuously working within two application, some times the user data is inter-mixed; i.e. values specific to say user1 starts getting displayed for user2 or vice-a-versa.
This behavior is random. And it can never be reproduced on internet explorer version 5.5. Only when version 6.0 is used, things start getting mixed. There are no cookies used by the application to store user speciifc data? only Httpsession object is used for user's session tracking. So how does these seperate sessions get intermixed? or is the problem with the browser version? Does struts framework mention some cookies for its own purpose and those cookies are causing problem?
Have anybody encountered such problem?
Can anybody please help? Any help would be highly appreciated.

Due to above explained problem, we started searching other alternatives for session management.
Can you please help me further?
-Rashmi
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
There shouldn't be a browser problem.
I hope your client browser cookie settings are enabled.

- the application is opened in two sepearte browser instances on the same machine.

How are you opening the two seperate browser instances?
Are you using :
Ctrl-N OR File->New->Window
by any chance while testing?


- Varun
Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
hi Varun,
I am not opening the instance with 'CTRL + N'. It is a totally new instance. So the session should not be mixed up with new instances of browser. Thats why i am exploring an option of URL rewriting.
However, I got the way to enforce URL rewriting in tomcat. The server.xml in conf directory needs to be modified with following tag -
<DefaultContext cookies="false" />
This enforces the application to use URL rewriting instaed of session even when cookies are enabled in IE options.
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Jeffrey Spaulding
Ranch Hand

Joined: Jan 15, 2004
Posts: 149
How by all means do you manage to get 2 _really_ separate instances of IE on one machine ?
 
jQuery in Action, 2nd edition
 
subject: enforcing URL rewriting in Tomcat