| Author |
about null value in struts 2
|
asif rafique
Greenhorn
Joined: Mar 25, 2007
Posts: 8
|
|
Hi everyone
i am using struts 2 in my project every thing is fine .
when i submit a form struts setter injection call setter of all bean properties and set there values, any text field that is left bland by user on submit it is initialize by empty string What i want a null instead of empty string
any help to submit a null value instead of String will be appreciated
thanks in advance
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Asif this is the correct behavior. When the request doesn't contain a request parameter, then the value of a parameter is null. If the request parameter exists, and has no value, then it is equivalent to an empty string. I think to avoid this, you must use the requiredstring-validator or implement your own parameter interceptor but the former would be the correct way of doing this...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
|
|
subject: about null value in struts 2
|
|
|