You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by An...@fiducia.de on 2006/10/25 08:42:03 UTC
Problem addressing hashtable keys in jsp-file
Hello!
I' ve got the bean jobs, which is defined in Action and provided by
setAttribute(). The bean itself is a Hashtable <String, ArrayList <SomeObject>>.
In the corresponding ActionForm-class, the getter-method jlist is defined as
follows:
Hashtable <String,ArrayList <SomeObject>> ht = new Hashtable <String,
ArrayList<SomeObject>>();
public ArrayList <SomeObject> getJlist(String key) {return ht.get(key)};
In the jsp, I want to iterate over the bean jobs like this:
<logic:iterate name="some_other" id="foo">
<logic:iterate name="jobs" property='<%= "jlist["+foo+"]"%>'>
</logic:iterate>
</logic:iterate>
When the jsp is run, I get the error: javax.servlet.jsp.JspException: No
collection found. Problem is the line 2 of the jsp-file :-).
Does anybody have a hint for me, how to write line 2 correctly?
Kind regards,
Andreas Hartmann
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Antwort: Problem addressing hashtable keys in jsp-file
Posted by An...@fiducia.de.
Hello!
The problem is fixed meanwhile. I forgot to set the Hashtable in the ActionForm
after it has been defined in Action. And the line 2 in the jsp must be correctly
written as <logic:iterate name="jobs" property='<%= "jlist("+foo+")"%>'>
Kind regards,
Andreas Hartmann
Andreas.Hartmann@fiducia.de schrieb am 25.10.2006 08:42:03:
>
> Hello!
>
> I' ve got the bean jobs, which is defined in Action and provided by
> setAttribute(). The bean itself is a Hashtable <String, ArrayList
> <SomeObject>>.
>
> In the corresponding ActionForm-class, the getter-method jlist is defined as
> follows:
>
> Hashtable <String,ArrayList <SomeObject>> ht = new Hashtable <String,
> ArrayList<SomeObject>>();
> public ArrayList <SomeObject> getJlist(String key) {return ht.get(key)};
>
>
> In the jsp, I want to iterate over the bean jobs like this:
>
> <logic:iterate name="some_other" id="foo">
> <logic:iterate name="jobs" property='<%= "jlist["+foo+"]"%>'>
> </logic:iterate>
> </logic:iterate>
>
> When the jsp is run, I get the error: javax.servlet.jsp.JspException: No
> collection found. Problem is the line 2 of the jsp-file :-).
>
> Does anybody have a hint for me, how to write line 2 correctly?
>
>
> Kind regards,
> Andreas Hartmann
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org