How do I proceed without comprimising MVC?? I know it is common validation,its just that my brain stopped working on Friday eve...
Its on the same page, what I mean by that is there is only one order page. it should similate like a client side verification, like we generally do. But in my situation , the data verfication is done form server side(the Qty is more or less). If the pop up window says , your ordered Qty is more than what we have in stock, then user will change that Qty. SO what I mean is the page is the same. Hope I was clear or I made worse Thanks for the quick reply though... Rajani
The above method will need code change at both client side and server side if new items are added are deleted.
Best thing to do would be to validate at the server side. Call a validation class from your servlet and based on success or failure return the user to same page/next page. This is extensible also because you can fetch all items from the db and validate the corresponding quantities against the values entered by the user. So in future if new items are added/items deleted you wont have to change the code.
Even you use the same jsp file to submit data to validate and display the result you can still do this.