Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data conversion in Struts

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Is there any framework to availd duplication of my data conversion of my request parameters in the validate method and in the TO object?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't understand the question. Could you explain in greater detail what it is you're trying to do?
[ April 14, 2008: Message edited by: Merrill Higginson ]
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, imagine I have a date field in my html form and also it is a mandatory field. Now when I validate it, I have to convert it to a Date type in my ActionForm calss. When the validation succeeds, I have to send it to the TO where I need to convert the String to a Date format in my Action class. So I was thinking that there might be a method something like BeanUtils and so on...?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not aware of any Struts utility that will do this. One of the weaknesses of Struts 1 is the fact that it offers little help in converting from Strings to other data types. You will find the support for this much greater in Struts 2.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. You have been helpful!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic