SuperMoonster
Programmer
Hello everyone,
I have not been able to load the contents of a Map in a html:select.
Here's what I'm doing. I have this action:
As you can see, it gives puts a map in the request scope. And when I wanna load the html:select, I do:
It gives me an error saying "no getter method for colecao under bean mapaColecao".
Here goes my map:
Ok, I'm doing something wrong. Just don't know what. How should I refer to the map? thanks.
I have not been able to load the contents of a Map in a html:select.
Here's what I'm doing. I have this action:
Code:
public class MontaBuscaColecaoAction extends Action {
public ActionForward execute (
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
ColecaoGerenciador colecaoGer = new ColecaoGerenciador();
Map mapa = colecaoGer.getAtributosColecao();
request.setAttribute("mapaColecao", mapa);
return mapping.findForward("success");
}
}
As you can see, it gives puts a map in the request scope. And when I wanna load the html:select, I do:
Code:
<html:form action="/ListaColecao.do" method="post" focus="descricao">
<html:select property="colecao" > <html:options collection="mapaColecao" property="colecao" labelProperty="descricao" /> </html:select> <html:text property="parametro" />
<html:submit value="Buscar"/> <html:reset value="Limpar"/>
</html:form>
It gives me an error saying "no getter method for colecao under bean mapaColecao".
Here goes my map:
Code:
public Map getAtributosColecao(){
Map mapa = new HashMap();
mapa.put("colecao","Coleção");
mapa.put("descricao","Descrição");
return mapa;
}
Ok, I'm doing something wrong. Just don't know what. How should I refer to the map? thanks.