This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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...