| Author |
Not able to display error message using spring validator
|
Sharath yadav
Greenhorn
Joined: May 03, 2006
Posts: 1
|
|
Hi all, I am working on a sample application using spring MVC. Step 1. I am displaying all product stock details. and alsi link to "sell" the stock. Step 2. when i click on "sell" all the stocks realated to a perticular product will be displpayed. In this page i have a text box to enter quantity to sell the stock. -> when i enter quantity greator than tha available quantity: i need to dispaly error message. Page is refreshing but error message is not displpayed on the page. public void validate(Object obj, Errors errors) { Product product = (Product) obj; if (product == null) { errors.rejectValue("order", "error.not-specified", null, "Value required."); } if (product.getOrder() == 0) { logger.info("Order value:::::" + product.getOrder()); errors.rejectValue("order", "error.not-specified", null, "Value required."); } } ANY IDEA? regards sharath
|
 |
Sonny Gill
Ranch Hand
Joined: Feb 02, 2002
Posts: 1209
|
|
What code are using in the JSP to display the error messages? You need to use Spring MVC form tags to get access to the error messages bound to the form backing object.
|
The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
|
 |
 |
|
|
subject: Not able to display error message using spring validator
|
|
|