struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ajay Chitre <ajay.chi...@diligentteam.com>
Subject RE: My first Struts question
Date Fri, 30 Nov 2001 20:43:40 GMT
Jeff,

Welcome to the list.  

You can find the searchable archive at;

http://www.mail-archive.com/struts-user@jakarta.apache.org/

Thanks.




-- Original Message --

>All,
>
>I've just subscribed to the Struts Users mailing list, so "Hello, all!"
>
>I also took the time to try to get the FAQ for the list and to find a
>searchable archive but the mailing list faq is non-existant (according
to
>ezmlm).  I've looked at the Jakarta site and I'm still needing a push in
>the
>right direction.
>
>I'm building my first Stuts "app" to learn more about it and at the moment
>I'm trying to use the html options JSP tag like so:
>
><html:select property="opponentName">
>    <html:options collection="opponents" 
>                  property="username" 
>                  labelProperty="username"/>
></html:select>
>
>The action form for this JSP has the following method:
>
>    public ArrayList getOpponents()
>    {
>        PlayerController playerController = new PlayerController();
>        
>        ArrayList list = playerController.getOpponents(ourName);
>
>        return list;
>    }
>
>
>Unfortunately, I get the following error:
>
>javax.servlet.ServletException: Cannot find bean under name opponents
>
>If I manually create a list on the JSP and stick on the page context like
>so:
>
><%
>// ...
>// create list
>// ...
>
>pageContext.setAttribute("opponents", list);
>
>%>
>
>...Then the page renders.
>
>Am I missing something?  How can I get the options tag to find the
>collection within the form?
>
>(Or am I completely bonkers thinking that the options tag is supposed to
>look for the array in various places?  Perhaps I need to change
>"<html:options collection="opponents"..." to something like "<html:options
>collection="form.opponents"..." 
>
>It just occurred to me to look in the bug database at jakarta.apache.org...
>
>I think I might be describing Bugzilla Bug 905 & 2096...
>
>If so, how can I, on the JSP, get to the ActionForm object so that I can
>do
>a setAttribute?
>
>Any help?
>
>+= Jeff Knee
>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
>
>

Ajay Chitre

Diligent Team, Inc.
(Where Diligent People Work as a Team)

http://www.DiligentTeam.com



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


Mime
View raw message