You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sjones <sj...@yahoo.com> on 2003/07/09 17:43:02 UTC

html:options

Good Morning Everyone.

I have a List object and i need my JSP page
to build a drop down list box using the List as the source
for the options.

I can do it with a scriplet but i need to one of the struts tags
<html:options>
<html:optionsCollection>

can anyone help me with use one of these tags.

I am looking at the java.docs but it doesn't really help me.

the List is also accessible from a classs name EqualityOperators

List o = EqualityOperators.getOperators();





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


Re: Struggling with html:options

Posted by sjones <sj...@yahoo.com>.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<HEAD>
<%@ page language="java"
 import=" com.ubs.directory.common.DirectoryEqualityOperator, java.util.*"
contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"
%>

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">

<LINK href="theme/Master.css" rel="stylesheet" type="text/css">

<TITLE></TITLE>
</HEAD>
<BODY>
<%
List o = DirectoryEqualityOperator.getOperationNames();
request.setAttribute("yerSelectBox", o);
%>
<html:form action="/search.do">
    <html:select property="srchMethod">
        <html:options collection="yerSelectBox" property="key"
labelProperty="value" />
    </html:select>
</html:form>

<form>
    <select name="xsrchMethod">
        <%
             for (int i=0; i < o.size(); i++) {
            String eqt = (String)o.get(i);
        %>
            <option value="<%=eqt %>"><%=eqt %></option>
        <%
             }
        %>
    </select>
<form>
</BODY>
</html:html>

I get this error,  can anyone help


[7/9/03 12:50:10:016 EDT] 868b89 WebGroup E SRVE0026E: [Servlet Error]-[No
getter method available for property key for bean under name yerSelectBox]:
javax.servlet.jsp.JspException: No getter method available for property key
for bean under name yerSelectBox
at org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:257)
at
org.apache.jsp._ypEqualityOperatorOptions._jspService(_ypEqualityOperatorOpt
ions.java:163)
at
com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
"sjones" <sj...@yahoo.com> wrote in message
news:behd26$5l0$1@main.gmane.org...
> Good Morning Everyone.
>
> I have a List object and i need my JSP page
> to build a drop down list box using the List as the source
> for the options.
>
> I can do it with a scriplet but i need to one of the struts tags
> <html:options>
> <html:optionsCollection>
>
> can anyone help me with use one of these tags.
>
> I am looking at the java.docs but it doesn't really help me.
>
> the List is also accessible from a classs name EqualityOperators
>
> List o = EqualityOperators.getOperators();




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