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.
In my struts application, am retrieving some values from the database for the user to edit. After editing, the newly entered value has to be submitted to the database.
The issue is, I am able to retrieve and display the value from the database, but the newly entered value is not getting updated, instead the old value is still getting submitted.
You're going to need to post some code before anyone will be able to help you. Have you determined at what point the problem is occuring? Did the new value get sent from the client back to the server in the request? Did your form get updated with the new value? Does the value in the form change from when the action starts to when you perform your DB update?
In your jsp, it doesn't look like you are setting the orderId value in your hidden field so that value is not returned to your action class and, therefore, not correct in your update SQL. I think your println of the SQL statement would show that.
Tom Reilly wrote:In your jsp, it doesn't look like you are setting the orderId value in your hidden field so that value is not returned to your action class and, therefore, not correct in your update SQL. I think your println of the SQL statement would show that.
But I dont have a problem with the orderId as I am not going to change it ...But my problem is with the quantity field as I need to update only the 'quantity' value with the new one everytime the user updates it .
Joined: Jun 01, 2010
But the orderId tells the database which row to update.
Tom Reilly wrote:But the orderId tells the database which row to update.
This is my cart .jsp which displays the available cart items
This is my Update Cart.java
This is my update cart.jsp. This gets displayed when the user clicks on the order id
And this is my Modify cart.java
...I am getting everything fine. but during the final execution, ie after changing the value of 'quantity' in the update cart .jsp, the newly entered value s not getting updated ...I am new to struts.
Joined: Aug 29, 2008