You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Luca Zago <lz...@e-tree.com> on 2002/09/17 12:55:11 UTC

Scripting variables outside iterate tag

Hi,
probably it's a not so hard question, but really I cannot find a 
solution to this simple problem.
This is the example of struts documentation:

| <logic:iterate id="element" name="myhashtable">
Next element is <bean:write name="element" property="value"/>
</logic:iterate>

everything works fine. But I want to use the bean |with the key 
'element', inside a scriptlet to do something like this:

<html:select property='userUri'>
| <logic:iterate id="element" name="myhashtable">|
              <html:option value='<%= |element|.getName()%>'><bean:write 
name='|element|' property='name'/></html:option>
</|logic:iterate>
</html:select>|

but I got obviously an exception becaus java.lang.Object doesn't contain 
getName(). The problem is that even the explicit conversion to my bean, 
doesn't work..
Somebody has some ideas?

Thank you in advance.

Luca


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Scripting variables outside iterate tag

Posted by Gemes Tibor <ge...@regens.hu>.
2002. szeptember 17. 12:55 dátummal Luca Zago ezt írtad:
> | <logic:iterate id="element" name="myhashtable">|
>
>               <html:option value='<%= |element|.getName()%>'><bean:write
> name='|element|' property='name'/></html:option>
> </|logic:iterate>
> </html:select>|

Check the html:options tag. 

Tib

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Scripting variables outside iterate tag

Posted by Miguel Angel Mulero Martinez <mi...@mad.tecsidel.es>.
Use the request.getParameter("element") or something similar.


-----Mensaje original-----
De: Luca Zago [mailto:lzago@e-tree.com]
Enviado el: martes, 17 de septiembre de 2002 12:55
Para: Struts Users Mailing List
Asunto: Scripting variables outside iterate tag

Hi,
probably it's a not so hard question, but really I cannot find a
solution to this simple problem.
This is the example of struts documentation:

| <logic:iterate id="element" name="myhashtable">
Next element is <bean:write name="element" property="value"/>
</logic:iterate>

everything works fine. But I want to use the bean |with the key
'element', inside a scriptlet to do something like this:

<html:select property='userUri'>
| <logic:iterate id="element" name="myhashtable">|
              <html:option value='<%= |element|.getName()%>'><bean:write
name='|element|' property='name'/></html:option>
</|logic:iterate>
</html:select>|

but I got obviously an exception becaus java.lang.Object doesn't contain
getName(). The problem is that even the explicit conversion to my bean,
doesn't work..
Somebody has some ideas?

Thank you in advance.

Luca


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>