• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

cookies in struts

 
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 ]
 
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!
reply
    Bookmark Topic Watch Topic
  • New Topic