Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cookies in struts

 
Bhaskar Reddy
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic