Struts Options problem

7 views
Skip to first unread message

JK

unread,
Jun 29, 2006, 12:40:42 AM6/29/06
to Java Web Application
I have been trying to determine the answer to this problem for a week
and not making much progress. I am new to Struts and trying to add an
Options box on a form.

When I run the code I get the following(first few lines of trace:

javax.servlet.jsp.JspException: No getter method available for property
leagueLabels for bean under name null
at
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:384)
at
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:248)
at
org.apache.jsp.playersearch_jsp._jspx_meth_html_options_0(playersearch_jsp.java:310)
at
org.apache.jsp.playersearch_jsp._jspx_meth_html_select_0(playersearch_jsp.java:283)
at
org.apache.jsp.playersearch_jsp._jspService(playersearch_jsp.java:153)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)


The HTML looks like this:
<jsp:useBean id="systemBean" class="com.stats.SystemBean"
scope="session"/>
<tr>
<td>
<bean:message key="label.search.leagueName"/>:
</td>
<td>
<html:select property="txtLeague" >
<html:options name="systemBean" property="leagueValues"
labelProperty="leagueLabels"/>
</html:select>
</td>
</tr>

Here is the bean getter methods found in the class systemBean:

public ArrayList getLeagueLabels() {
return this.leagueLabels;
}

public ArrayList getLeagueValues() {
return this.leagueValues;
}

I don't really understand why it is failing to find SystemBean and
shows null in the trace. Any help is appreciated. Thanks.

prateek jain

unread,
Jun 30, 2006, 12:32:28 AM6/30/06
to javaw...@googlegroups.com
You can download "jakarta struts live" online book from "theserverside.com". It will solve most of your problems.

On 6/29/06, JK <jon.k...@comcast.net> wrote:

I have been trying to determine the answer to this problem for a week
and not making much progress.  I am new to Struts and trying to add an
Options box on a form.

When I run the code I get the following(first few lines of trace:

javax.servlet.jsp.JspException: No getter method available for property
leagueLabels for bean under name null
        at
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:384)
        at
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:248)
        at
org.apache.jsp.playersearch_jsp._jspx_meth_html_options_0(playersearch_jsp.java:310)
        at
org.apache.jsp.playersearch_jsp._jspx_meth_html_select_0 (playersearch_jsp.java:283)

Zaid

unread,
Jul 8, 2006, 1:29:19 AM7/8/06
to Java Web Application
Simply, replace html:options with html:optionsCollection

Zaid

Reply all
Reply to author
Forward
0 new messages