• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how does encodeURL() work in struts ?

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
learning the HttpSession and session tracking using "encodeURL". It sounds pretty clear in normal servlet/jsp. But if I use struts, how does this "encodeURL" work ? In the following example --

"struts-config.xml":
<forward name="success" path="/next.jsp"/>

"my.jsp":
<form:form action="/register">
...

How can the "encodeURL()" be used in above two places ??
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that <html:form> does a urlRewrite automatically, as does <html:link>. I'm not 100% sure, but I believe Struts also does an automatic urlRewrite for a forward.
 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so,

1. do you mean that, if I use struts, I do NOT need to write any code syntax like "encodeURL" anywhere ??

2. When you say it is automatic, do you mean if the browser doesn't support cookie, the URL will automatically be appended by a "jsessionid=.." ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. As long as you use the struts forwards and struts tags, you don't need to worry about using encodeURL.

2. In order for URL Rewriting to work, your application server must be configured to use it. The jsessionid=.. will be appended to your URL regardless of whether the client has cookies enabled or not. Whether your application server uses this parameter to keep track of sessions as opposed to cookies will depend on whether you have configured it to do so.
[ June 09, 2005: Message edited by: Merrill Higginson ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic