This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes URL encoding in Struts is not working! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "URL encoding in Struts is not working!" Watch "URL encoding in Struts is not working!" New topic
Author

URL encoding in Struts is not working!

Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
    
    1
I have a Struts-1.0.2-based web application running under Tomcat 4.1.x and Apache 1.3.x.
I am using the Struts <html:link> tags for all links. Unfortunately, session management only works with cookies enabled. If the user has cookies turned off, it doesn't automatically revert to URL encoding. The result is that the user cannot access the site properly.
How do I make Struts detect cookie support and use the appropriate method for session management? It should use cookies if they are supported; otherwise it should revert to use encodeURL().
TIA
Geoffrey


Sun Certified Programmer for the Java 2 Platform
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
This actually depends on your app sever setting. If URL rewriting is enabled, it will rewrite the URL. If rewriting is not enabled, it will not rewrite the URL. At least it works in WebSphere...


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: URL encoding in Struts is not working!
 
Similar Threads
most challenging topics in SCWCD
swhy do I still see "jsessionid=.." when cookies is ON
URL encoding in Struts with/without cookies
Enforcing URL rewriting for tomcat
Regd Sess Mgmt: How do i find out if the browser has cookies disables?