This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "URL encoding in Struts is not working!" Watch "URL encoding in Struts is not working!" New topic

URL encoding in Struts is not working!

Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
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().

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 team, Newsletter 039.
I agree. Here's the link:
subject: URL encoding in Struts is not working!
It's not a secret anymore!