Foros de discusión

Can I get null/Exception from ParamUtil.getIngeger(...) instead of default?

thumbnail
Thomas Krauß, modificado hace 12 años.

Can I get null/Exception from ParamUtil.getIngeger(...) instead of default?

New Member Mensajes: 22 Fecha de incorporación: 18/08/11 Mensajes recientes
Hello!

I want to get a return null/throw Exception from ParamUtil.getInteger(request,"myFormInteger") if the given parameter can't parsed as integer (character etc).
Better: Exception!

Because default return value is int not Integer, I can't set null as "default value".

The only thing I can see at the moment is to generate a lot of evil magic numbers to test if the parse was valide or not emoticon
that poor code style I have to do then.