wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:iterator question" Watch "s:iterator question" New topic
Author

s:iterator question

aaron walker
Greenhorn

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
Greenhorn

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

In package.properties 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
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Currency can be formatted using the <s:text> tag:

http://struts.apache.org/2.1.6/docs/formatting-dates-and-numbers.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: s:iterator question
 
Similar Threads
Struts2 test condition in s:if not working
Dynamic radio button problem
s:iterator, can you save values other control tags like s:label? POJO
A diffrent type of checkbox problem
Struts 2 iterating enums