You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Crazy Dave <mu...@yahoo.com> on 2002/02/26 13:16:49 UTC

Html:Select

I'm trying to show a predefined arraylist of beans in
a html:select tag
and I keep getting the following exception.


description The server encountered an internal error
(Internal Server Error) that prevented it from
fulfilling this request.

javax.servlet.ServletException: No getter method
available for property securityModule for bean under
name org.apache.struts.taglib.html.BEAN at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:457)

My ArrayList is setup correctly as the following code
in the JSP 

<%
MfDebug.line( "TEST IT OUT" );
Object[] al = ((ArrayList)getServletContext(
).getAttribute(APPCONSTANTS.DROPDOWN_SECURITY_MODULES)).toArray(
);
for ( int i = 0 ; i<al.length; i++ ) {
  ComboBoxBean cb = (ComboBoxBean)al[i];
  MfDebug.p( "Label: " + cb.getLabel( ) + "    Value:
" + cb.getValue( ) );
}
MfDebug.line( );
%>

produces:

[ TEST IT OUT ]-------------------------------------
Label: < Please select module >    Value:
Label: Security    Value: 1
Label: eCorp    Value: 2
Label: Muesliflakes    Value: 3
----------------------------------------------------

My <html:select> tag is as follows:

<html:select property="securityModule" size="1">
  <html:options collection="<%=
APPCONSTANTS.DROPDOWN_SECURITY_MODULES %>"
  property="value" labelProperty="label"/>
</html:select>

<%

Cheers Dave

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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