This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am designing Struts application and in JSP i have used <html:form>tag and for form data i used <display:table > tag. Now data is showing properly but when i am editing form data and submitting to action that time i am unable to get submitted form data instead i m getting old form which was set in session . Following is code for ref.
deep kulkarni wrote:Hi,
Now data is showing properly but when i am editing form data and submitting to action that time i am unable to get submitted form data instead i m getting old form which was set in session .
Why are you setting data in session, you can any time populate/store data in request scope, that will solve your problem.
I am new to struts application and display:table tag also. Can you please elaborate more on request Scope .Because i have tried following
<display:table id="customerList" name="requestScope.CustomerForm.customerList" pagesize="10" >
that time its not get data to display (in action class i have populate list and list is form property )
when i am setting this form in session and using following
<display:table id="customerList" name="sessionScope.CustomerForm.customerList" pagesize="10" >
that time it is displaying list data properly.Because i am populating list and setting form in session in action class .
Sagar Rohankar wrote:OK, I'll make it simple, remove your Action Form (CustomerForm) class from "session" scope. like, edit the struts-config.xml entry for CustomerAction
I am learning Struts 2 and I am interested to learn about the original poster's problem and solution. Are the path and scope attributes of the action tag (as in your example) now deprecated in struts 2? I ask as I added the attributes to one of my action mappings and both path and scope were not recognised.