Thanks
Alan,
I tried by writing a action which increments a counter.
I am using the counter in my
jsp to repeat the rows. But i can see the variable incremented in action class but the variable is not getting changed in the jsp.
Can you explain me why this kind of problem occurs.. i have different states of Actionforms with jsps. I am confused how the struts maintains the ActionForm with the JSP are mapped through the config file.
I am posting my code will you have a look at it please.......
Incrementer Action:
public class Incrementer extends Action{
public Incrementer() { }
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest req,HttpServletResponse res)
throws Exception {
TransForm trans = (TransForm)form;
int countVS = trans.getAddVitalSign();
countVS = countVS+1;
if(countVS != 0) trans.setAddVitalSign(countVS);
return mapping.findForward("success");
}
}
jsp tag is <html:text name="transForm" property="addVitalSign"/>
Entrees in the config are
<form-bean name="transForm" type="org.fdny.cts.actionforms.TransForm"/>
<action path="/AddRow"
type="Incrementer"
name="transForm"
scope="request" validate="false">
<forward name="success" path="/DisplayTrans.do" />
</action>
<action path="/DisplayTrans"
type="DisplayTrans"
name="transForm"
scope="request" validate="false">
<forward name="success" path="/jsp/TRANS.jsp" />
</action>