SuperMoonster
Programmer
Hello,
I am having problems in sending a parameter from my action to my jsp. I want to know what I gotta do to get the parameter in the jsp.
My action is the following:
<tt>
public class ListaColecaoAction extends Action{
public ActionForward execute (
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
List lista = ColecaoService.getInstance().getColecaoList();
request.setAttribute("col", lista);
return mapping.findForward("ok");
}
}
</tt>
As you see, I did a "request.setAttribute("col", lista);", but it doesn't seem enough.
I am trying to get it in my jsp with a logic:iterate like this:
<tt>
<logic:iterate id="element" name="col" scope="request" type="auge.bean.Colecao" >
<tr>
<td><bean:write name="element" property="colecao" /></td>
<td><bean:write name="element" property="descricao" /></td>
</tr>
</logic:iterate>
</tt>
but it gives me the error "cannot find bean col in scope request". I know the problem is only regarding the parameter, because when I put a scriplet to call the method in the jsp, is worked perfectly. But I don't wanna use the scriplet.
What do I gotta do to make ir work? What if I want to use JSTL (c:forEach)?
Thank you all
I am having problems in sending a parameter from my action to my jsp. I want to know what I gotta do to get the parameter in the jsp.
My action is the following:
<tt>
public class ListaColecaoAction extends Action{
public ActionForward execute (
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
List lista = ColecaoService.getInstance().getColecaoList();
request.setAttribute("col", lista);
return mapping.findForward("ok");
}
}
</tt>
As you see, I did a "request.setAttribute("col", lista);", but it doesn't seem enough.
I am trying to get it in my jsp with a logic:iterate like this:
<tt>
<logic:iterate id="element" name="col" scope="request" type="auge.bean.Colecao" >
<tr>
<td><bean:write name="element" property="colecao" /></td>
<td><bean:write name="element" property="descricao" /></td>
</tr>
</logic:iterate>
</tt>
but it gives me the error "cannot find bean col in scope request". I know the problem is only regarding the parameter, because when I put a scriplet to call the method in the jsp, is worked perfectly. But I don't wanna use the scriplet.
What do I gotta do to make ir work? What if I want to use JSTL (c:forEach)?
Thank you all