fill in optionsCollection Struts

0

I have a question to fill out an OptionsCollection of Struts.

I have an Action where I retrieve the data and through the request I pass the result. From here, whatever I put in the option gives me an error. Thanks in advance. I leave the Struts Action code.

    EquipoDAOInter equipoDao = new EquipoDAO();
    GenericDao generic = new GenericDao();
    List<Equipo> listadoEquipo = equipoDao.listaEquipos();
    request.setAttribute("listaEquipos", listadoEquipo);

    return mapping.getInputForward();

The class I have associated to the Form, on the one hand I have the class equipment and on the other the Form where I instancio the class.

I put the select code:

<html:select property="equipo" value="Select">
  <html:option value="Select">Select</html:option>
  <html:optionsCollection name="equipoForm" property="equipo" label="" value="" /> 
</html:select>

Thanks

    
asked by Oscar Marés Barrera 09.10.2018 в 19:09
source

1 answer

0

The problem is that you have not defined correctly where the list of equipment is: the name attribute should be listTeam and not teamForm

    
answered by 09.10.2018 в 20:31