Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Struts2 : TypeConverter and Null Values

Sami Dalouche

2007-02-25


Hi,

Let's consider we have a S2 select box that is not required (s:select
required="false" ).

The property to which it is bound can be null. However, by default,
Struts2 complains using the invalid field error message.

One way to circumvent this would be, I guess, to use some
NullSafeTypeConverter, associated to the java.lang.Object type.

Several questions :
1] Is this the best approach ?
2] Why doesn't Struts ship NullSafeTypeConverter by default ?

Regards,
Sami Dalouche


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.