This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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.
subject: URL encoding in Struts is not working!
Similar Threads
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?
most challenging topics in SCWCD