I show a list of demandes on my jsp1 and when I choose one I wanna go to jsp2 show the demand details and allow people to comment below.
I'm having this problem, when I send the selected demande and go to jsp2 I find this error : Cannot find bean: "demand" in scope: "request"
Here's my code:
JSP1:
<logic:iterate id="demande" name="demandes">
<html:link page ="/PAGES/commentaire.jsp" paramId="demand"
paramName="demande" paramProperty="content">
<bean:write name="demande" property="content" /><br>
</html:link>
</logic:iterate>
JSP2:
<bean:write name="demand" scope="request"/>
I really dont know where the problem might come from, cuz every thing seems pretty right. Does anyone have an idea.
Seconde version: JSP1:
<html:link page ="/show.do" paramId="demande" paramName="demande" >
<bean:write name="demande" property="demandeId" /><br>
</html:link>
struts-config.xml:
<action path="/show"
type="action.ActionAfficherDemande"
validate="true"
input="/PAGES/JSP1.jsp"
scope="session">
<forward name="success" path="/PAGES/JSP2.jsp" redirect="true"/>
</action>
ActionAfficherDemande.java :
HttpSession session = request.getSession();
Demande myDemande = (Demande) session.getAttribute("demande");