• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

how to tranfer cookie with jsp ?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi room,
in case webrower is turned cookie off, so we can't create an cookie file on client's machine. I know in servlet we can use URL rewriting :

response.encodeURL(url);
//it will return an with parameter JSESSIONID=xxx.. belong to url

could you tell me how can i do the same with jsp ?

Thank you,
Hiep
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The non-elegant solution would be to use the same code you'd use in a servlet only in a scriptlet as in:


A more elegant solution would be to find a custom taglib that does the same thing. Someone else may be able to suggest one.
 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Merrill,
Thank you for your response.
I have tried the solution before posting the question but URL is after encoded nothing change, it means it doesn't attach the session id to URL as servlet.
does any one has other suguest?
Thank you,
Hiep
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try response.encodeRedirectURL().

HTH
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to use JSTL's tag <c:url value="some.jsp">




Or you can use Strut's tag <html:rewrite >
<html:rewrite page="/assets/page.js"/>
[ February 21, 2005: Message edited by: Eugene Lucash ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic