aspose file tools*
The moose likes Struts and the fly likes Struts2 QUERY Regarding Built in Type Conversions in Struts2 Framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 QUERY Regarding Built in Type Conversions in Struts2 Framework" Watch "Struts2 QUERY Regarding Built in Type Conversions in Struts2 Framework" New topic
Author

Struts2 QUERY Regarding Built in Type Conversions in Struts2 Framework

RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
This is the statement in Apache site .

By default, Struts2 automatically converts many common types between the String value
received as a form field value and the object or primitive type that is to be set on the action.
These include boolean, Boolean, char, Character, int, Integer, float, Float, long, Long,
double, Double, and Date.


As usual i failed to understand the above

When the user enters some number in textfield (This will be in a String Format)


And in my Action class i have a property called number with int type



Will the conversion takes place automatically ?

Please help to learn a drop in this struts2 ocean


If you want something you never had do something which you had never done
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yes, it takes place automatically. (It might have been quicker to just try it ;)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts2 QUERY Regarding Built in Type Conversions in Struts2 Framework