Why ((Integer) weightModel.getObject()).intValue(); throws exception
- by yakup
I am learning Wicket by "Enjoying Web Development with Wicket" book. And in an example:
int weight = ((Integer) weightModel.getObject()).intValue();
is used.
When I click Submit button it throws exception.
But after changed the code to:
int weight=Integer.parseInt( (String) weightModel.getObject());
It works fine. What is the reason for…