<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 09:51:10 +0000</lastBuildDate>
    <item>
      <title>(Java) Struts bean:write format attribute - springett</title>
      <link>https://snipplr.com/view/1958/struts-beanwrite-format-attribute</link>
      <description>&lt;p&gt;You can use these attributes to format the display of your form bean properties. This works pretty well in displaying currency and date/time values. For example, you can display 1234.567 as $1,234.57 and 08/12/2006 as Aug 12, 2006. &#13;
&#13;
In order to get the second tag to work you will need to add the following line to your resource bundle:&#13;
&#13;
myapp.currency.format=$#,000.00&#13;
&#13;
The preferred way is to use the second format because it makes the code portable. Plus, if you want to change the format, you can make the change in resource bundle without having to worry about changing all your JSPs.&#13;
&#13;
The type of the property being formatted cannot be String. The format attribute simply uses default format (display the property as is) when the property is of type java.lang.String. In other words:&#13;
&#13;
private double amount; // will be formatted correctly&#13;
private String amount; // will NOT be formatted at all&lt;/p&gt;</description>
      <pubDate>Thu, 11 Jan 2007 05:30:32 UTC</pubDate>
      <guid>https://snipplr.com/view/1958/struts-beanwrite-format-attribute</guid>
    </item>
    <item>
      <title>(Java) Writing a Properties File - springett</title>
      <link>https://snipplr.com/view/1921/writing-a-properties-file</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 04 Jan 2007 03:38:29 UTC</pubDate>
      <guid>https://snipplr.com/view/1921/writing-a-properties-file</guid>
    </item>
    <item>
      <title>(Java) Reading a Properties File - springett</title>
      <link>https://snipplr.com/view/1920/reading-a-properties-file</link>
      <description>&lt;p&gt;reading in a properties file from the file system&lt;/p&gt;</description>
      <pubDate>Thu, 04 Jan 2007 03:36:09 UTC</pubDate>
      <guid>https://snipplr.com/view/1920/reading-a-properties-file</guid>
    </item>
  </channel>
</rss>
