You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Xiuyu Zhang <xi...@yahoo.com> on 2003/10/15 02:55:54 UTC
logic:iterate tag with html:select
Hi all,
I am try it to do a list in the action class and pass
it to a jsp page as the html:select options. I am
using Strut 1.0.
in the action class, I do this:
....
ArrayList codes = new ArrayList();
codes.add("--select one--");
....
request.setAttribute("CODES", codes);
in jsp, I try to do:
<td>
<html:form action="/hospitalsearch">
<html:select property="hospitalCode">
<logic:iterate id="code"
type="java.util.ArrayList" name="CODES"
indexId="ctr">
<html:option value="<%= code.get(ctr) %>"/>
</html:select>
<html:submit>submit</html:submit>
</logic:iterate>
</html:form>
I got the following errors:
Compilation of
'C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_hesm_dir_hesm\jsp_servlet\__hospitalsearch.java'
failed:
--------------------------------------------------------------------------------
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_hesm_dir_hesm\jsp_servlet\__hospitalsearch.java:319:
cannot resolve symbol
probably occurred due to an error in
/hospitalsearch.jsp line 52:
<html:option value="<%= code.get(ctr.intValue()) %>"/>
--------------------------------------------------------------------------------
Full compiler error(s):
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_hesm_dir_hesm\jsp_servlet\__hospitalsearch.java:319:
cannot resolve symbol
symbol : method setValue (java.lang.Object)
location: class
org.apache.struts.taglib.html.OptionTag
_html_option0.setValue(code.get(ctr.intValue())); //[
/hospitalsearch.jsp; Line: 52]
^
1 error
Do you know how can I make it right?
Thanks,
katlyn
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org