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 have a menu from where I will click on a hyperlink which takes me to listing page. In my listing page I have checkbox before each record and delete button in the bottom of the listing.
Now, when user selects records from the listing and clicks delete button, I have to go and delete those records from the database.
on error, I have to show same listing with error message on top when I say return (mapping.getInputForward()); it is taking me to menu page. How can i get back to my listing page without getting whole data from the database again?
or it is compulsory to get whole records from database in both success and error conditions.
I am not sure why return (mapping.getInputForward()); is taking me to menu page. How can I get back to my listing page
getInputForward() returns an ActionForward that corresponds to the "input" property of the Action.
In your case this is 'index.jsp' <action input="/index.jsp" path="/messages" scope="request" ...
If you want to forward to "ListMessages.jsp" use: - mapping.findForward("continueList") OR - change your action mapping to <action input="/ListMessages.jsp" path="/messages" scope="request" ... and continue using getInputForward()