• 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

JSTL (c:url) - problem with jsessionid

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I have the following configuration: Tomcat, JSTL, Struts.

1. The Tomcat's server.xml contains the following context section:

<Context path="" docBase="/path-to-unpackedWAR/">
<Parameter name="some-name" value="some-value"/>
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_myapp_log." suffix=".txt" timestamp="true"/>
</Context>

the docBase elements points to the location where previously I have unpacked the application's war file.

2. Used is JSTL's <c:url> tag to ensure URL encoding (for disabled cookies scenario).

RESULT:
Running Tomcat went smoothly and the application has been starteed normally. Everything works fine in the case that the browser has enabled cookies.

THE PROBLEM: when cookies has been disabled in the browser, this ends up in encoding sessionid 2 times thus resulting in not available resource. I.e. when I poin to the link produced by <c:url value="some-resource"> this will produce the following link : http://mysite.com/some-resource;jsessionid=##some_id##;jsessionid=##some_id##

What I have found:
If I change the path element of the Context (i.e <Context path="/it_works") and access the site by http://mysite.com/it_works then everythink is fine. the <c:url value="some-resource"> encodes url properly and gives the following http://mysite.com/it_works/some-resource;jsessionid=##some_id##

Question: Where is the problem, is anybody can help. Is there any parameters that have to be set additionally?
 
reply
    Bookmark Topic Watch Topic
  • New Topic