RE: Hashmap and logic:equal

2002-08-29 Thread Darryl Nortje

I see what you're saying... I don't know why it doesn't work.
What I would try then is to set the Hashmap in the form and retrieve it off
the form object. 

Tell me, if item1 = "Y" do you want to show nothing, and can item2 be equal
to "x"

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:44 PM
To: Struts Users Mailing List
Subject: RE: Hashmap and logic:equal



"I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value"


I am a bit confused ,I will clarify..
Aa an eample, in my loadAction:
Map myMap = new Map();
myMap.put("item1","X");
myMap.put("item2","Y");
request.setAttrite("infoObject",myMap);


In my Page:


To:'Struts Users Mailing List' <[EMAIL PROTECTED]>
cc:

Subject:RE: Hashmap and logic:equal


This is how I got it of my form object


and this is how I got it out of a collection object

 

In the form object I have a getJspAction() method and in the collection
object I have a getIsReadonly() method.

I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:10 PM
To: [EMAIL PROTECTED]
Subject: Hashmap and logic:equal


I am hoping that someone could point me in the right direction.
 I have been searching the archives and have not come accross anything that
I can relate to.

Using the equal tags, what is the best way to compare a value retieved from
a Hashmap?

I would like to put a Hashmap (or similar)  into request scope and use the
logic:equals tag. and do something like this.

 Show A 
 Show B 
 Show C 

Do I need to wrap this in simple class?
The docs make reference to the support of indexed properties, is there a
way to get the tag to look up the name of the key?


Thanks All



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Hashmap and logic:equal -[my solution]

2002-08-28 Thread Morycz, Felicia V

I got your Hashmap way to work as well as the dynclass way.  Thanks for your
example code.

So which is the preferred way of doing this:

1. use dynclass to dynamically create a bean (called variableDataBean in
this example).  Then in your jsp:
//declare a the dyn bean

.
.
.
//use the dyn bean
Your dynclass credit limit is $ bean.

2. use a HashMap wrapped in your form bean (called responseBean in this
example).  Then in your jsp:

//use the form bean HashMap
Your credit limit is $ bean.


Any reason to use one over the other?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 12:51 PM
To: Struts Users Mailing List
Subject: RE: Hashmap and logic:equal -[my solution]



Test class:
--
public class HashWrapper implements java.io.Serializable {
java.util.HashMap map = new java.util.HashMap();

public HashWrapper() {
 map.put("item1", "H");
 map.put("item2", "E");
 map.put("item3", "I");
}

 public String getItem(String item){
  return (String)map.get(item);
 }
}

request setAttribute("hashWrapper",new HashWrapper());

--
Then I used the syntax for the tags:






[EMAIL PROTECTED] on 08/27/2002 11:44:02 AM

Please respond to "Struts Users Mailing List"
   <[EMAIL PROTECTED]>

To:"Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:

Subject:RE: Hashmap and logic:equal



"I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value"


I am a bit confused ,I will clarify..
Aa an eample, in my loadAction:
Map myMap = new Map();
myMap.put("item1","X");
myMap.put("item2","Y");
request.setAttrite("infoObject",myMap);


In my Page:


To:'Struts Users Mailing List' <[EMAIL PROTECTED]>
cc:

Subject:RE: Hashmap and logic:equal


This is how I got it of my form object


and this is how I got it out of a collection object

 

In the form object I have a getJspAction() method and in the collection
object I have a getIsReadonly() method.

I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:10 PM
To: [EMAIL PROTECTED]
Subject: Hashmap and logic:equal


I am hoping that someone could point me in the right direction.
 I have been searching the archives and have not come accross anything that
I can relate to.

Using the equal tags, what is the best way to compare a value retieved from
a Hashmap?

I would like to put a Hashmap (or similar)  into request scope and use the
logic:equals tag. and do something like this.

 Show A 
 Show B 
 Show C 

Do I need to wrap this in simple class?
The docs make reference to the support of indexed properties, is there a
way to get the tag to look up the name of the key?


Thanks All



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Hashmap and logic:equal -[my solution]

2002-08-28 Thread Jeff_Mychasiw


Test class:
--
public class HashWrapper implements java.io.Serializable {
java.util.HashMap map = new java.util.HashMap();

public HashWrapper() {
 map.put("item1", "H");
 map.put("item2", "E");
 map.put("item3", "I");
}

 public String getItem(String item){
  return (String)map.get(item);
 }
}

request setAttribute("hashWrapper",new HashWrapper());

--
Then I used the syntax for the tags:






[EMAIL PROTECTED] on 08/27/2002 11:44:02 AM

Please respond to "Struts Users Mailing List"
   <[EMAIL PROTECTED]>

To:"Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:

Subject:RE: Hashmap and logic:equal



"I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value"


I am a bit confused ,I will clarify..
Aa an eample, in my loadAction:
Map myMap = new Map();
myMap.put("item1","X");
myMap.put("item2","Y");
request.setAttrite("infoObject",myMap);


In my Page:


To:'Struts Users Mailing List' <[EMAIL PROTECTED]>
cc:

Subject:RE: Hashmap and logic:equal


This is how I got it of my form object


and this is how I got it out of a collection object

 

In the form object I have a getJspAction() method and in the collection
object I have a getIsReadonly() method.

I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:10 PM
To: [EMAIL PROTECTED]
Subject: Hashmap and logic:equal


I am hoping that someone could point me in the right direction.
 I have been searching the archives and have not come accross anything that
I can relate to.

Using the equal tags, what is the best way to compare a value retieved from
a Hashmap?

I would like to put a Hashmap (or similar)  into request scope and use the
logic:equals tag. and do something like this.

 Show A 
 Show B 
 Show C 

Do I need to wrap this in simple class?
The docs make reference to the support of indexed properties, is there a
way to get the tag to look up the name of the key?


Thanks All



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Hashmap and logic:equal

2002-08-27 Thread Jeff_Mychasiw


"I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value"


I am a bit confused ,I will clarify..
Aa an eample, in my loadAction:
Map myMap = new Map();
myMap.put("item1","X");
myMap.put("item2","Y");
request.setAttrite("infoObject",myMap);


In my Page:


To:    'Struts Users Mailing List' <[EMAIL PROTECTED]>
cc:

Subject:RE: Hashmap and logic:equal


This is how I got it of my form object


and this is how I got it out of a collection object

 

In the form object I have a getJspAction() method and in the collection
object I have a getIsReadonly() method.

I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:10 PM
To: [EMAIL PROTECTED]
Subject: Hashmap and logic:equal


I am hoping that someone could point me in the right direction.
 I have been searching the archives and have not come accross anything that
I can relate to.

Using the equal tags, what is the best way to compare a value retieved from
a Hashmap?

I would like to put a Hashmap (or similar)  into request scope and use the
logic:equals tag. and do something like this.

 Show A 
 Show B 
 Show C 

Do I need to wrap this in simple class?
The docs make reference to the support of indexed properties, is there a
way to get the tag to look up the name of the key?


Thanks All



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>








--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Hashmap and logic:equal

2002-08-27 Thread Darryl Nortje

This is how I got it of my form object


and this is how I got it out of a collection object



In the form object I have a getJspAction() method and in the collection
object I have a getIsReadonly() method.

I think with Hashmap you just need key or value, so where you have
property="mapkey1" change to key or value

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:10 PM
To: [EMAIL PROTECTED]
Subject: Hashmap and logic:equal


I am hoping that someone could point me in the right direction.
 I have been searching the archives and have not come accross anything that
I can relate to.

Using the equal tags, what is the best way to compare a value retieved from
a Hashmap?

I would like to put a Hashmap (or similar)  into request scope and use the
logic:equals tag. and do something like this.

 Show A 
 Show B 
 Show C 

Do I need to wrap this in simple class?
The docs make reference to the support of indexed properties, is there a
way to get the tag to look up the name of the key?


Thanks All



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: