I am using JDK 1.4, Struts 1.2.9, WAS 6.0, Win XP. Page1.jsp- Has a link to show the ordering time and other information for the purchased items for a particular user. Page2.jsp- Opens the jsp and does a <bean:write> from a collection-ArrayList(which has Java Bean Objects). ResultBean.java - This Java bean Object has getXXX() and setXXX() for all the information that is displayed on the Page2.jsp.
The problem is that I want to write the "datesubmittedfrom" (using a calender) from the Page2.jsp. It should be an editable field whereas the others are read only. This field should be set in the ResultBean.java( the bean and not the Action Form for the same JSP) I am confused, the UserBean.java is populated from the database(after some manipulation). Can i call the setDatesubmittedfrom()directly from the JSP ?? I have used indexed properties and saw a recent post also given by Merrill, but still couldnt reach a solution. If this is not the right way, can you please guide me through the correct way. Help would be appreciated. Thanks, Roshani
The <html:form> tag should not be inside the <logic:iterate> loop. The beginning tag should be right after the <body> tag and the end tag should be right before the </body> tag, so that there is only one form on the page.
If your ActionForm is in session scope, it should work fine. However, if your ActionForm is in request scope, you will also have to add some "lazy initialization" behavior to your indexed getter. This link will explain how to do it.