aspose file tools*
The moose likes JSP and the fly likes Session attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Session attributes" Watch "Session attributes" New topic
Author

Session attributes

Daniel Rajan
Greenhorn

Joined: May 21, 2008
Posts: 8
How can we check whether the user input obtained via a dropdown in a JSP page matches any of the elements of the cookie array?
[ May 23, 2008: Message edited by: Daniel Rajan ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

What cookie array?

Can you explain, in a little more detail, exactly what you're trying to do?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Daniel Rajan
Greenhorn

Joined: May 21, 2008
Posts: 8
I am trying to compare the input recieved from the dropdown with a set of values stored in a list.Can you suggest a way to do that using cookie or sessions?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Where is this list coming from?
Where are you storing it.

When you say list, do you mean something that implements the java.util.List interface?

What do cookies and/or session have to do with this?
Daniel Rajan
Greenhorn

Joined: May 21, 2008
Posts: 8
I am using the list to store and diplay a set of values in the dropdown box,so that the user can select one value from amongst them.
Now i need to make sure that user is not able to select any of these values twice.To do so,I am trying to store the user input in a session attribute & compare this value with the set of values already present in the list.How do I go about this?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

How would a user select more than one value from a dropdown?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

P.S. Since this really has nothing to do with cookies, you might want to go back and edit your subject.
Daniel Rajan
Greenhorn

Joined: May 21, 2008
Posts: 8
What I meant was that the user shouldn't be allowed to choose the same value in the dropdown more than once.If he does,he should be directed to a JSP page,which displays a corresponding message.
[ May 23, 2008: Message edited by: Daniel Rajan ]
 
jQuery in Action, 2nd edition
 
subject: Session attributes