Looks like it may not be wrapped in a <html:form> tag in your JSP. You
probably also want a field named "toSelect", with accessor and mutators in
your form bean, to hold the selected value.
On 8/1/06, Francisco Exposito Aguilera <fcoexposito@hotmail.com> wrote:
>
> Hi,
>
> I have a Bean:
>
> package project.struts.General;
> import java.util.ArrayList;
> import java.util.Collection;
> import java.io.*;
>
> public class Prueba implements Serializable
> {
> private Collection empresas=new ArrayList();
>
> public Collection getEmpresas()
> {
> empresas.add("string1");
> empresas.add("string2");
> return(empresas);
> }
> }
>
> and a jsp where I write:
>
> <jsp:useBean id="test" class="project.struts.General.Prueba" />
> <html:select property="toSelect">
> <html:optionsCollection property="empresas" name="test"/>
> </html:select>
>
> But it doesn't work. I receive the error
> javax.servlet.ServletException: Cannot find bean under name
> org.apache.struts.taglib.html.BEAN
>
> How can I solve this issue? Or what is the correct way to generate this?
>
> Thanks in advance
>
> _________________________________________________________________
> Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN
> Amor
> & Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
|