掲示板
Can I get null/Exception from ParamUtil.getIngeger(...) instead of default?
12年前 に Thomas Krauß によって更新されました。
Can I get null/Exception from ParamUtil.getIngeger(...) instead of default?
New Member 投稿: 22 参加年月日: 11/08/18 最新の投稿
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
that poor code style I have to do then.
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
that poor code style I have to do then.