File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Displaying modified VO  values in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying modified VO  values in JSP " Watch "Displaying modified VO  values in JSP " New topic

Displaying modified VO values in JSP

Sunitha Mudidani

Joined: Apr 25, 2006
Posts: 28

I have a VO (say, SourceVO) that has the Date values stored in DATE type variable.
As I need to change the format and display that in the front end, i am suggested to create another VO(say, DestVO) that will hold the values in the required format and use PropertyUtils.copyProperties(destVo, sourceVo) to copy the values. But I have to set the values in the String format after conversions, explicitly by calling the Setter method. Similarly If any of the values are null, I have to put a '--' string in those fields, by calling the setter methods explicitly after checking for null.

1) Can the entire thing be done in a easy manner rather than above ?

2)If Iam using the original VO itself, then all these modifications need to be done in the jsp itself using scriptlets and expressions (These can be avoided using struts tags to some extent but not entirely.. )
Is the above approach correct to avoid this situation ?

Pls suggest.

I agree. Here's the link:
subject: Displaying modified VO values in JSP
It's not a secret anymore!