Hi Max Sorry for writing the wrong code. In my code : --- Hashtable hash=new Hashtable(); hash.put("page 1",new ArrayList()); hash.put("page 2",new ArrayList()); hash.put("page 3",new ArrayList()); the code i am using in java is if(hash.containsKey(new String("page 2")) ArrayList value=hash.get(new String("page 2"))
i want to this will be implemented through the tag library. ---------------------------------------- | page 1 | questions in a arraylist | ---------------------------------------- | page 2 | questions in a arraylist | ----------------------------------------- | page 3 |questions in a arraylist | ---------------------------------------- this is a key-value pare. i think now you under stand the question. i am already reterive this through scriplets and implement, but now i want this through the tag library. is any tag provided for this type of functionality. Regards Shashi BHushan ----- Original Message ----- From: "Max Cooper" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, March 27, 2003 7:49 PM Subject: Re: how to get a single value from hashtable > I am not exactly sure what you are asking. Consider posting a minimal but > complete code (JSP, Java) example to help us understand if the following > info doesn't help: > > Hashtable.elements() returns an Enumeration of the values, not the keys. I > believe that logic:iterate will just iterate though the Enumeration of > values. > > hash.contains(new String("one")) will return false in your example code, > because there is no map entry with a value of "one". I think you mean > hash.containsKey("one"), which is much faster and will return true. Read the > API docs: > http://java.sun.com/j2se/1.4.1/docs/api/java/util/Hashtable.html > > Also, the newer HashMap class might be faster than Hashtable, since HashMap > is not synchronized. > > -Max > > ----- Original Message ----- > From: "shashi_struts" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Wednesday, March 05, 2003 10:04 PM > Subject: how to get a single value from hashtable > > > hi > i am using the struts and jstl in my web application and using the > logic:iterate for iterating the hashtable,arraylist. > I faced the problem at this point:- > i am getting any tag for retrival of only one value from the hashtable that > we are getting through java function. > ex:- > Hashtable hash=new Hashtable(); > hash.put("one","first"); > hash.put("two","second"); > the code i am using in java is > if(hash.contains(new String("one")) > String value=hash.get(new String("one")) > > but i am not getting this using struts or jstl > > Please help me > Regards > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]