I am new to struts 2
i created an action class that insert data from JSP page to a bean using modelDriven interface.
the problem is that i have some non string properties in the bean like Long, Date ... etc
the problem is:
when i press submit button in the jsp page i get an error saying that it did not find the a string setter for that particular property.
for example if i have in my bean
when the action class that implement the model driven is exectuted, it fires a run time exception
is there anyway to solve this problem without writing a String setter for my Date property?
posted 3 years ago
well i found that struts implicit conversion from string to date will use my local system format which is mm/dd/yyyy, there fore when i pass for example this date 15/04/2012 it fails because there is month 15.
i think what i need is custom converter.
my problem now is how to make the custom converter global. i don't want to copy the converter in every place i need the conversion, why not to put in global place and every action that needs it will refer to it.
how can i do that?