wood burning stoves 2.0*
The moose likes Struts and the fly likes cookies in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "cookies in struts" Watch "cookies in struts" New topic
Author

cookies in struts

Bhaskar Reddy
Ranch Hand

Joined: Dec 17, 2002
Posts: 52
Hi,

In my index.jsp, there are 3 fields - username text, password text & 'remember me' checkbox. When the user has entered username & password and selected 'remember me' checkbox, I need to authenticate the username/password combination & put the username in browser's cookie.

I am able to authenticate as well as set up the cookie, but my problem is on the displaying part. Here is the code -


Interestingly, both <logic:notPresent> & <logic : present> works when the cookie is set; and both <logic:notPresent> & <logic resent> fail when cookie is removed from the browser. One would think that one of them should work when cookie is available (or removed).

It would be great if anyone can point out where my mistake is!

Thanks in Adv...
[ June 20, 2007: Message edited by: Bhaskar Reddy ]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Nothing jumps out at me. I have never used the cookie attribute of the logic:present tag. Have you tried removing the scope attribute?

- Brent
Bhaskar Reddy
Ranch Hand

Joined: Dec 17, 2002
Posts: 52
I did try removing the scope attribute...

I want to use JSTL version of these tags but couldn't really succeed with them... If anyone knows the JSTL version of using the cookie in JSP, pls let me know!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cookies in struts
 
Similar Threads
Retriving values from html:checkbox in a jsp
logic:equal tag not evaluting inside html:button tag
Validator Problems
Cookies and Struts
Struts Validation Empty alert Box