• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get checkbox status into session

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In my home page,i have one checkbox called showprice.
Iam not submitting my home page directly,but i have some links in my home page.
i want to set the session for status of checkbox in those links(jsp,s or servlets)
If i selects checkbox,price should visible to users.
if i don't,price should not visible to users.
for this how can i maintain session.

Please suggest...

Regards,
Kiran.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When do you want the session to reflect the change in the checkbox? Do you have to wait until a link is clicked, or would it be better to flip the session state as soon as the checkbox is changed?
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

"i want to set the session for status of checkbox in those links(jsp,s or servlets)"



Session is defined for a user. If you are thinking of maintaining this status for all user, I suggest that you use the DB to store this status. When any user logins or comes to your home page, access the DB on page onload and set the status in the session.

You can use a static variable also if you are using POJOs. But using this will depend on what kind of framework you are on.

A more elaborate post will let us help you. Try and post as much info as you can.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joe Mathew:
If you are thinking of maintaining this status for all user ...

I fail to see what part of the original post indicates this intention.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic