File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes s:iterator question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:iterator question" Watch "s:iterator question" New topic

s:iterator question

aaron walker

Joined: Jul 31, 2009
Posts: 3
I am using an s:iterator tag to display information from a data base. It is only for display, but I need it to show formatted as currency. Is there a way to do this on the jsp? Or is it better just to format it on the database? I would need the coverageAmount to show as a formatted number.

Here is my iterator:

Thanks in advance
Mike Cobelmach

Joined: Jun 17, 2009
Posts: 19
Its easy, you can found it on Struts pages.

In you would have

And your code would look like this

Btw on linked page is misstake in last example - formated value is in single quotes.
David Newton

Joined: Sep 29, 2008
Posts: 12617

Currency can be formatted using the <s:text> tag:
I agree. Here's the link:
subject: s:iterator question
It's not a secret anymore!