Data conversion


When a method is called, its input parameters are populated with values received from request, which are converted to the type of the method parameter to which it is bound. 

Accepted method parameter types are byte, Byte, char, Character, short, Short, int, Integer, float, Float , long, Long, double, Double, boolean, Boolean, Date, String, net.sourceforge.javajax.UploadFile and their respective arrays. 
Any other type would be treated as a bean. 

Date parameters are converted considering the received value a Long representing the value of the Date in milliseconds. Additional formats can be specified in an init-param of the servlet in web.xml file:

<param-value>dd MMM yyyy | yyyy-MM-dd | dd-MM-yyyy | ddd, dd MMM yyyy</param-value>

That is, a pipe ( | ) separated list of valid date format. All of them will be used when trying to generate a date from a receiverd parameter, if a valid Date object can not be created an "invalid.format" message is generated for the specified field. 

Number parameters can be passed with or without integer/decimal separator. Correct format is evaluated based on a Locale object, that describes which are, for that locale, the correct separators we should expect in the number. 
By default, user locale is used to perform conversion, or you can specify in web.xml an application level Locale that must be used: 



Support JavAjax

JavAjax is a free to use software, so you will never be asked for money to download and use it.
However, if you find it useful, you may consider to make a donation to let the work go on!

Support This Project


(You will be redirected to the donation page. Donation is done through Paypal)