A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCM Java EE 6 Enterprise Architect Exam Guide
this week in the
struts2: setting string value to int field of a bean does not throw any exception
Joined: Mar 18, 2011
Jan 24, 2012 02:31:34
I had a jsp which has a field user age.
age: <s:textfield name="user.age" id="user.age" ></s:textfield>
in action class, i have i create user bean getter and setter.
it works fine if i enter age as integer but if i enter
for age then it does not throw any exception.
where is the problem?
Joined: Nov 17, 2011
Feb 03, 2012 08:02:26
If I understand correctly the problem, use validation.
I agree. Here's the link:
subject: struts2: setting string value to int field of a bean does not throw any exception
How OGNL automatically maps to the appropiate Object
Struts2 very simple validation doesn't work
Error while validating the input
Avoiding Default primitive wrapper value display on JSF page
why getters/setters in java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014