Harini Iyer wrote:Hi all..
I have problem in validating double field..am using struts 1.3 and am manually validating the fields in my action class and not using any framework..
Harini Iyer wrote:
Issue is, I have declared a field 'double' in my formbean.
And if i enter any invalid characeter say, a string in the field, it is not throwing error, instead, it takes it as 0.0.
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
You can anytime start using Struts Validator, its not that much difficult.
For start: http://struts.apache.org/1.2.4/userGuide/dev_validator.html
You mean, at server side/action class, you're getting a value 0.0 for non numbers ? Have you checked your form bean, have you resetting somewhere property value in action form ?
Also a code snippet of JSP, FORM and action class will help.
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Harini Iyer wrote:So how should my set method be?
Harini Iyer wrote:The variables are double in my db too.. so, should i also have to convert and send???
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Harini Iyer wrote:
It says, cannot conver double to string.
Harini Iyer wrote:so, i tried converting to string..
javax.servlet.ServletException: java.lang.NullPointerException
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|