|
error message on jsp
Am trying to learn struts...not easy.
Anyway, I want to display an error message on a page if the user forgets to enter a field. I figured out how to do that with the validate() method in the ActionForm. OK, but now I want to make the error show up if they did something the database does not like. So I am off into the Action now.
Lets say they want to order some widgets, and there were some in the inventory when the screen came up, but they looked at it a while, they went and had a cup of coffee, and when they got back and clicked the "order" button the application goes out to the database and lo and behold, there are no more widgets left. So how do I deal with this and show that nice little error message on the same screen. "sorry, the last widget has been sold".
|