Struts e a tag select

2 respostas
M

Olá, pessoal!

Estou tentando (tentando mesmo!) montar um código utilizando a tag “select” do Struts e tô levando bomba".

Alguém pode pra me ajudar a resolver este problema ou apontar a luz no fim do túnel?

<--------------------JSP ----------------->
<table>
<tr>
<html:form action="/consultaen" name=“escritorioNegocioForm” type=“br.gov.caixa.cfm.forms.EscritorioNegocioForm” >
<td>
Escritório de Negócio:
<html:select property=“codigo”>
<html:options collection=“enList” property=“codigo” labelProperty=“nome” />
</html:select>
</td>
</html:form>
</tr>
</table>

<----------------------------- ActionForm ------------------------------>

public class ConsultaENActionList extends Action {

public ActionForward execute(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response)

throws IOException, ServletException {
// Default target to success
	String target = new String("success");
	Collection enList = null;
	enList = EscritorioNegocioData.getEscritoriosNegocio();
	request.setAttribute("enList", enList);

	// Forward to the appropriate View
	return (mapping.findForward(target));
}

}

<--------------------------------- Erro ---------------------------------->

javax.servlet.jsp.JspException: Cannot find bean under name enList

2 Respostas

V

oi,

Que tipo de Collection seu metodo EscritorioNegocioData.getEscritoriosNegocio(); esta retornando ??? um List um Set,

e veja se este collection tem vinculo com um JB e se seus set’s e get’s estao corretos…

coloque o codigo do seu JB que tem o collection…

t+

A

Quando for referenciar seus beans, coloque o nome completo dos packages!!!

Criado 14 de julho de 2005
Ultima resposta 15 de jul. de 2005
Respostas 2
Participantes 3