• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

beans properties and modelDriven in struts 2

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
teddy clayton
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

regards
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic