Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get checkbox status into session  RSS feed

 
ki dondap
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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?
 
Joe Matthew
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!