struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aiping <apkir...@yahoo.com>
Subject Re: html:optionsCollection problem
Date Wed, 02 Aug 2006 01:12:02 GMT
Hi, 
   
  I also got the same problem, but this site offer some insights:
   
  http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=58&t=008283

Romu <romu31@gmail.com> wrote:
  





where pays is the property of your form


2006/8/1, Francisco Exposito Aguilera :
>
> I´ve added it into a but I obtain the
> error
>
> Cannot create iterator for project.struts.General.Prueba@3fc47c
>
> I´ve modified some code because I want to obtain a select with all info of
> a
> table which is placed in a database when the page is loaded; and this page
> only comes from a link, not from another page with an associated action
> (therefore, nothing has been saved in session).
>
> public class Prueba implements Serializable
> {
> private Collection empresas=new ArrayList();
> DTOEmpresa empresa = new DTOEmpresa();
>
> public Collection getEmpresas()
> {
> empresa.setNifEmpresa("A11111111");
> empresas.add(empresa);
> return(empresas);
> }
> public void setEmpresas(String empresa)
> {
> empresas.add(empresa);
> }
> }
>
> 
> 
> 
> 
>
>
> I don´t know if I have explained my issue as I should.
>
> Thanks a lot.
>
>
>
> >From: Monkeyden 
> >Reply-To: "Struts Users Mailing List" 
> >To: "Struts Users Mailing List" 
> >Subject: Re: html:optionsCollection problem
> >Date: Tue, 1 Aug 2006 11:13:36 -0400
> >
> >Looks like it may not be wrapped in a 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 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:
> >>
> >>
> >>
> >> 
> >>
> >>
> >>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
> >>
> >>
>
> _________________________________________________________________
> Horóscopo, tarot, numerología... Escucha lo que te dicen los astros.
> http://astrocentro.msn.es/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



AiPing  
 
"The greatest regrets in our lives are the risks we did not take. 

If you think something will make you, HAPPY, GO FOR IT. 
Remember that we pass this way only once." 
 



 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min
or less.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message