Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Struts
response.addCookie is not working
Shusha Li
Greenhorn
Posts: 4
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi, Everyone,
I have a problem adding a cookie to my
JSP
page which is in
struts
. I add the following codes to my jsp page:
<% Cookie cookie1 = new Cookie("message", "Hello!"); cookie1.setMaxAge(24 * 60 * 60); response.addCookie(cookie1); Cookie[] cookies = request.getCookies(); for(int i = 0; i < cookies.length; i++) { if (cookies[i].getName().equals("message")) { out.println("The cookie says " + cookies[i].getValue()); } } %>
But when deploy my application at
Tomcat
6, I can NOT find the cookie"Message" printed out.....
Please help!!!Thanks!!!
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Nothing to do with Struts.
Did you try refreshing the page?
Shusha Li
Greenhorn
Posts: 4
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yes, I refreshed and still the added cookie not shown.....
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Regarding Cookies
Tomcat refusing to set a cookie...
setting a cookie in jsp
add user
Cookie access with EL expression
More...