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.
Generally, it's best to make properties on an ActionForm either Strings or booleans. If you want to make sure the value could always be converted to an int, you can do so through validation. If you're getting the value as an int from some external source, just convert it to a String when populating your ActionForm.
This might be a good entry for the FAQ. I see this question come up often. While playing around with WebWork a few weeks ago I noticed that pages seemed to work fine using data types such as Integer.
There are two reasons that I use Strings for all editable fields. The first mentioned above is that it gives you the ability to tell if the user has left the field blank or entered a zero value (I have not tried the "convertNull initialization parameter", but that would be another way).
The second reason is for validation. Say your form has a Distance field that you expect to be a number but the user enters "Ten Miles". The Struts framework will try to populate your form's Integer property, but since it cannot convert this string into an Integer it will ignore the user's value. By the time sever side validation is performed, the user's value will be lost, so you cannot even tell the user that they entered an invalid number. Also, if the page hits another validation error then the page will be redisplayed with values from the Form and the Distance field will be empty.
Okay, a third reason...If you do not do your own conversion of numbers to strings then you have to rely on the default formatting of the toString method. That works okay most of the time but you may end up with values such as "3.9999999997" and large numbers are formatted using scientific notation.
I do use types such as int for fields that the user cannot edit such as hidden fields, and list selection value.