RE: Map iterate problem

2002-11-13 Thread Sukhenko, Mikhail (Contr)
your MultiMap class does not have getKey() method which  translates to.



-Original Message-
From: Mark Ayad [mailto:mark@;javamark.com]
Sent: Tuesday, November 12, 2002 10:18 AM
To: Struts Users Mailing List
Subject: Map iterate problem


I have a Map which I place into the Application Context using the following
line in a plugin init:

servlet.getServletContext().setAttribute("mm", new MultiMap());

The map is:

public class MultiMap
{
 public Map values = new HashMap();
 
public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}

public MultiMap()
{   
 values.put("foo","bar");
 
 values.put("you","me");
}

public Map getMap()
{
 return values ;
}
}

In the JSP I try to iterate over this map using (which doesn't throw any
exceptions):

 
 

However When I try to use 



I get:

javax.servlet.jsp.JspException: No getter method for property key of bean
mm

What am I missing ?




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Re: Map iterate problem Application Scope

2002-11-12 Thread Mark Ayad

One of thoes afternoons it all works now, I've attatche all the code

urgh ?

- Original Message -
From: "Vinh Tran" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 6:15 PM
Subject: RE: Map iterate problem


> Mark:
>
> Please include code otherwise I can't help youand include the error
you
> are receiving.
>
> Vinh
>
> -Original Message-
> From: Mark Ayad [mailto:mark@;javamark.com]
> Sent: Tuesday, November 12, 2002 11:05 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re: Map iterate problem
>
>
> Map iterate problemSorry that doesn't work
>
> >From the documentation:
>
> id
>
> The name of a page scope JSP bean that will contain the current element of
> the collection on each iteration.
>
> but my bean is stored in the application scope:
>
> Unless my problem lies in my iterate tag ?
>   - Original Message -
>   From: Vinh Tran
>   To: Struts Users Mailing List ; [EMAIL PROTECTED]
>   Sent: Tuesday, November 12, 2002 4:45 PM
>   Subject: RE: Map iterate problem
>
>
>   sorry...forgot the property attribute...
>
>   
> -Original Message-
>     From: Vinh Tran [mailto:vinht@;processintelligence.com]
> Sent: Tuesday, November 12, 2002 10:40 AM
> To: Struts Users Mailing List
> Subject: RE: Map iterate problem
>
>
> Or you can define your Map from MultiMap
>
> (Note: some changes made to MutiMap)
> public class MultiMap
> {
>  public Map mymap = new HashMap();
>
> public void setValue(String key, Object value) {
> values.put(key, value);
> }
>
> public Object getValue(String key) {
> return values.get(key);
> }
>
> public MultiMap()
>
>
>  values.put("foo","bar");
>
>  values.put("you","me");
> }
>
> public Map getMyMap()
> {
>  return myMap;
> }
>     }
>
>     then.
>
> then simply iterate through yourMapHope this works.Vinh
>   -Original Message-
>   From: Hookom, Jacob John [mailto:hookomjj@;uwec.edu]
>   Sent: Tuesday, November 12, 2002 10:19 AM
>   To: Struts Users Mailing List
>   Subject: RE: Map iterate problem
>
>
>   Your multimap must be an instance of java.util.Map to get
> logic:iterate to recognize/handle it properly.
> -Original Message-
> From: Mark Ayad [mailto:mark@;javamark.com]
> Sent: Tue 11/12/2002 9:17 AM
> To: Struts Users Mailing List
> Cc:
> Subject: Map iterate problem
>
>
> I have a Map which I place into the Application Context using the
> following line in a plugin init:
>
> servlet.getServletContext().setAttribute("mm", new MultiMap());
>
> The map is:
>
> public class MultiMap
> {
>  public Map values = new HashMap();
>
> public void setValue(String key, Object value) {
> values.put(key, value);
> }
>
> public Object getValue(String key) {
> return values.get(key);
> }
>
> public MultiMap()
>
>
>  values.put("foo","bar");
>
>  values.put("you","me");
> }
>
> public Map getMap()
> {
>  return values ;
> }
> }
>
> In the JSP I try to iterate over this map using (which doesn't
throw
> any exceptions):
>
>  
>  
>
> However When I try to use
>
> 
>
> I get:
>
> javax.servlet.jsp.JspException: No getter method for property key
of
> bean
> mm
>
> What am I missing ?
>
>
>
>
>
>
>
> --
--
> --
>
>
>   --
>   To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@;jakarta.apache.org>
>   For additional commands, e-mail:
> <mailto:struts-user-help@;jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>
>



MemoryPlugin.java
Description: java/


MultiMap.java
Description: java/


test.jsp
Description: Binary data
--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


RE: Map iterate problem

2002-11-12 Thread Vinh Tran
Mark:

Please include code otherwise I can't help youand include the error you
are receiving.

Vinh

-Original Message-
From: Mark Ayad [mailto:mark@;javamark.com]
Sent: Tuesday, November 12, 2002 11:05 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Map iterate problem


Map iterate problemSorry that doesn't work

>From the documentation:

id

The name of a page scope JSP bean that will contain the current element of
the collection on each iteration.

but my bean is stored in the application scope:

Unless my problem lies in my iterate tag ?
  - Original Message -
  From: Vinh Tran
  To: Struts Users Mailing List ; [EMAIL PROTECTED]
  Sent: Tuesday, November 12, 2002 4:45 PM
  Subject: RE: Map iterate problem


  sorry...forgot the property attribute...

  
-Original Message-
From: Vinh Tran [mailto:vinht@;processintelligence.com]
Sent: Tuesday, November 12, 2002 10:40 AM
To: Struts Users Mailing List
Subject: RE: Map iterate problem


Or you can define your Map from MultiMap

(Note: some changes made to MutiMap)
public class MultiMap
{
 public Map mymap = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}

public MultiMap()


 values.put("foo","bar");

 values.put("you","me");
}

public Map getMyMap()
{
 return myMap;
}
}

then.

then simply iterate through yourMapHope this works.Vinh
  -Original Message-
  From: Hookom, Jacob John [mailto:hookomjj@;uwec.edu]
  Sent: Tuesday, November 12, 2002 10:19 AM
      To: Struts Users Mailing List
  Subject: RE: Map iterate problem


  Your multimap must be an instance of java.util.Map to get
logic:iterate to recognize/handle it properly.
-Original Message-
From: Mark Ayad [mailto:mark@;javamark.com]
Sent: Tue 11/12/2002 9:17 AM
To: Struts Users Mailing List
Cc:
Subject: Map iterate problem


I have a Map which I place into the Application Context using the
following line in a plugin init:

servlet.getServletContext().setAttribute("mm", new MultiMap());

The map is:

public class MultiMap
{
 public Map values = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}

public MultiMap()


 values.put("foo","bar");

 values.put("you","me");
}

public Map getMap()
{
 return values ;
}
}

In the JSP I try to iterate over this map using (which doesn't throw
any exceptions):

 
 

However When I try to use



I get:

javax.servlet.jsp.JspException: No getter method for property key of
bean
mm

What am I missing ?








--


  --
  To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
  For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Re: Map iterate problem Application Scope

2002-11-12 Thread Robert
I actually had this problem with other objects (not necessarily maps) 
and it turned out that the logic and bean tags would only find my 
objects if I set them in the pageContext object, meaning I would have to 
do this in my JSP:


<% pageContext.setAttribute( "mm" 
pageContext.getServletContext().getAttribute("mm"), 
pageContext.APPLICATION ); %>
...

It sucked, but it worked. Essentially the tags were always looking in 
the pageContext object and not the servletContext. Or maybe it was a 
problem with the pageContext implementation in Tomcat, don't know which.

For JavaBeans, I could use a  tag that pointed to my bean 
and the tags would find it as well. So if I set a bean in session / 
request scope, say in an Action, I would have to use a jsp:useBean tag 
on the page that defined the bean that was already there.

Robert

Mark Ayad wrote:

Map iterate problemThe iterate examples seem to use Maps that are created in the PageScope. In the case of a Map-backed action form.

However what I'm trying to do is iterate over a an Object placed in the application scope: a.k.a. I can't seem to get the  to work even though the bean mm is sitting quite hapily in the application scope.

servlet.getServletContext().setAttribute("mm", new MultiMap());

public class MultiMap
{
public Map values = new HashMap();

   public void setValue(String key, Object value) {
   values.put(key, value);
   }

   public Object getValue(String key) {
   return values.get(key);
   }
  
   public MultiMap()
   {  
values.put("foo","bar");
   }
  
   public Map getMap()
   {
return values ;
   }
}

Is the possible ?


 



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




Re: Map iterate problem Application Scope

2002-11-12 Thread Mark Ayad
Map iterate problemThe iterate examples seem to use Maps that are created in the 
PageScope. In the case of a Map-backed action form.

However what I'm trying to do is iterate over a an Object placed in the application 
scope: a.k.a. I can't seem to get the  to work even though the bean mm 
is sitting quite hapily in the application scope.

servlet.getServletContext().setAttribute("mm", new MultiMap());

public class MultiMap
{
 public Map values = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}
   
public MultiMap()
{  
 values.put("foo","bar");
}
   
public Map getMap()
{
 return values ;
}
}

Is the possible ?




Re: Map iterate problem

2002-11-12 Thread Mark Ayad
Map iterate problemSorry that doesn't work

>From the documentation:

id

The name of a page scope JSP bean that will contain the current element of the 
collection on each iteration.

but my bean is stored in the application scope:

Unless my problem lies in my iterate tag ?
  - Original Message - 
  From: Vinh Tran 
  To: Struts Users Mailing List ; [EMAIL PROTECTED] 
  Sent: Tuesday, November 12, 2002 4:45 PM
  Subject: RE: Map iterate problem


  sorry...forgot the property attribute...
   
  
-Original Message-
From: Vinh Tran [mailto:vinht@;processintelligence.com]
Sent: Tuesday, November 12, 2002 10:40 AM
To: Struts Users Mailing List
Subject: RE: Map iterate problem


Or you can define your Map from MultiMap
 
(Note: some changes made to MutiMap)
public class MultiMap
{
 public Map mymap = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}
   
public MultiMap()
{  
 values.put("foo","bar");

 values.put("you","me");
}
   
public Map getMyMap()
{
 return myMap;
}
}
 
then.
 
then simply iterate through yourMapHope this works.Vinh
  -Original Message-
  From: Hookom, Jacob John [mailto:hookomjj@;uwec.edu]
  Sent: Tuesday, November 12, 2002 10:19 AM
  To: Struts Users Mailing List
  Subject: RE: Map iterate problem


  Your multimap must be an instance of java.util.Map to get logic:iterate to 
recognize/handle it properly.
-Original Message- 
From: Mark Ayad [mailto:mark@;javamark.com] 
Sent: Tue 11/12/2002 9:17 AM 
To: Struts Users Mailing List 
    Cc: 
Subject: Map iterate problem


I have a Map which I place into the Application Context using the following 
line in a plugin init:

servlet.getServletContext().setAttribute("mm", new MultiMap());

The map is:

public class MultiMap
{
 public Map values = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}
   
public MultiMap()
{  
 values.put("foo","bar");

 values.put("you","me");
}
   
public Map getMap()
{
 return values ;
}
}

In the JSP I try to iterate over this map using (which doesn't throw any 
exceptions):

 
 

However When I try to use



I get:

javax.servlet.jsp.JspException: No getter method for property key of bean
mm

What am I missing ?







--


  --
  To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
  For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>



RE: Map iterate problem

2002-11-12 Thread Vinh Tran
Title: Map iterate problem



sorry...forgot the property 
attribute...
 
property="mymap" 
name="mm" scope="application">

  -Original Message-From: Vinh Tran 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 12, 
  2002 10:40 AMTo: Struts Users Mailing ListSubject: RE: 
  Map iterate problem
  Or 
  you can define your Map from MultiMap
   
  (Note: some changes made to 
  MutiMap)
  public class MultiMap{ public Map mymap 
  = new HashMap();    public void setValue(String key, 
  Object value) {    values.put(key, 
  value);    }    public Object 
  getValue(String key) {    return 
  values.get(key);    
  }   public 
  MultiMap()    {   
  values.put("foo","bar"); 
  values.put("you","me");    
  }   public Map 
  getMyMap()    { return 
  myMap;    }}
   
  then.
   
  then 
  simply iterate through yourMapHope this works.Vinh
  
-Original Message-From: Hookom, Jacob John 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 12, 2002 10:19 
AMTo: Struts Users Mailing ListSubject: RE: Map 
iterate problem
Your multimap must be an instance of java.util.Map to get logic:iterate 
to recognize/handle it properly.

  -Original Message- From: Mark Ayad 
  [mailto:[EMAIL PROTECTED]] Sent: Tue 11/12/2002 9:17 AM 
  To: Struts Users Mailing List Cc: 
  Subject: Map iterate problem
  I have a Map which I place into the Application Context 
  using the following line in a plugin 
  init:servlet.getServletContext().setAttribute("mm", new 
  MultiMap());The map is:public class 
  MultiMap{ public Map values = new 
  HashMap();    public void setValue(String key, 
  Object value) {    
  values.put(key, value);    }    
  public Object getValue(String key) 
  {    return 
  values.get(key);    
  }   public 
  MultiMap()    {   
  values.put("foo","bar"); 
  values.put("you","me");    
  }   public Map 
  getMap()    { return values 
  ;    }}In the JSP I try to iterate over 
  this map using (which doesn't throw any 
  exceptions):  However When I 
  try to useI 
  get:javax.servlet.jsp.JspException: No getter method for property 
  key of beanmmWhat am I missing 
?
<>--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


RE: Map iterate problem

2002-11-12 Thread Vinh Tran
Title: Map iterate problem



Or you 
can define your Map from MultiMap
 
(Note: 
some changes made to MutiMap)
public 
class MultiMap{ public Map mymap = new 
HashMap();    public void setValue(String key, Object 
value) {    values.put(key, 
value);    }    public Object 
getValue(String key) {    return 
values.get(key);    
}   public 
MultiMap()    {   
values.put("foo","bar"); 
values.put("you","me");    
}   public Map 
getMyMap()    { return 
myMap;    }}
 
then.
 
then 
simply iterate through yourMapHope this works.Vinh

  -Original Message-From: Hookom, Jacob John 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 12, 2002 10:19 
  AMTo: Struts Users Mailing ListSubject: RE: Map iterate 
  problem
  Your multimap must be an instance of java.util.Map to get logic:iterate 
  to recognize/handle it properly.
  
-Original Message- From: Mark Ayad 
[mailto:[EMAIL PROTECTED]] Sent: Tue 11/12/2002 9:17 AM 
To: Struts Users Mailing List Cc: Subject: 
Map iterate problem
I have a Map which I place into the Application Context 
using the following line in a plugin 
init:servlet.getServletContext().setAttribute("mm", new 
MultiMap());The map is:public class 
MultiMap{ public Map values = new 
HashMap();    public void setValue(String key, Object 
value) {    values.put(key, 
value);    }    public Object 
getValue(String key) {    return 
values.get(key);    
}   public 
MultiMap()    {   
values.put("foo","bar"); 
values.put("you","me");    
}   public Map 
getMap()    { return values 
;    }}In the JSP I try to iterate over this 
map using (which doesn't throw any 
exceptions):  However When I try 
to useI 
get:javax.servlet.jsp.JspException: No getter method for property 
key of beanmmWhat am I missing 
  ?
<>--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


Re: Map iterate problem

2002-11-12 Thread Mark Ayad
That doesn't seem to help. When I try the same example where MultiMap
extends the ActionForm Class, but it created as a form beam it work fine.

Any ideas ?

- Original Message -
From: "Hookom, Jacob John" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 12, 2002 4:19 PM
Subject: RE: Map iterate problem


Your multimap must be an instance of java.util.Map to get logic:iterate to
recognize/handle it properly.

-Original Message-
From: Mark Ayad [mailto:mark@;javamark.com]
Sent: Tue 11/12/2002 9:17 AM
To: Struts Users Mailing List
Cc:
Subject: Map iterate problem



I have a Map which I place into the Application Context using the following
line in a plugin init:

servlet.getServletContext().setAttribute("mm", new MultiMap());

The map is:

public class MultiMap
{
public Map values = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}

public MultiMap()


 values.put("foo","bar");

 values.put("you","me");
}

public Map getMap()
{
 return values ;
}
}

In the JSP I try to iterate over this map using (which doesn't throw any
exceptions):




However When I try to use



I get:

javax.servlet.jsp.JspException: No getter method for property key of bean
mm

What am I missing ?












> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




RE: Map iterate problem

2002-11-12 Thread Hookom, Jacob John
Your multimap must be an instance of java.util.Map to get logic:iterate to 
recognize/handle it properly.

-Original Message- 
From: Mark Ayad [mailto:mark@;javamark.com] 
Sent: Tue 11/12/2002 9:17 AM 
To: Struts Users Mailing List 
Cc: 
Subject: Map iterate problem



I have a Map which I place into the Application Context using the following 
line in a plugin init:

servlet.getServletContext().setAttribute("mm", new MultiMap());

The map is:

public class MultiMap
{
 public Map values = new HashMap();

public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}
   
public MultiMap()
{  
 values.put("foo","bar");

 values.put("you","me");
}
   
public Map getMap()
{
 return values ;
}
}

In the JSP I try to iterate over this map using (which doesn't throw any 
exceptions):

 
 

However When I try to use



I get:

javax.servlet.jsp.JspException: No getter method for property key of bean
mm

What am I missing ?






<>--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>


Map iterate problem

2002-11-12 Thread Mark Ayad
I have a Map which I place into the Application Context using the following line in a 
plugin init:

servlet.getServletContext().setAttribute("mm", new MultiMap());

The map is:

public class MultiMap
{
 public Map values = new HashMap();
 
public void setValue(String key, Object value) {
values.put(key, value);
}

public Object getValue(String key) {
return values.get(key);
}

public MultiMap()
{   
 values.put("foo","bar");
 
 values.put("you","me");
}

public Map getMap()
{
 return values ;
}
}

In the JSP I try to iterate over this map using (which doesn't throw any exceptions):

 
 

However When I try to use 



I get:

javax.servlet.jsp.JspException: No getter method for property key of bean
mm

What am I missing ?