I'm a Struts2 newbie. I'm using Struts2 with the typical datamodel UserItem
inside an Action. The datamodel doesn't look good when using with the Struts tag <s:property value="userItem.foo"/>
.
What I want to do is write a static util method Helper.printNice(Foo)
that takes parameter Foo and prints out the value contained in Foo in a user-friendly display.
How do I use the Struts property tag with the static method? Something like this
com.helper.Helper.printNice(<s:property value="userItem.foo"/>)
.
The reason for this is my web app is reading data populated by a vendor, which looks like this ["string1", "string2" , ...] in many columns. Obviously, I don't want to display in this format to the end user. The helper method would make it look like string1 <br> string2<br>, etc...