Hi Kumar,

when you look at the documentation for bean:write
(http://jakarta.apache.org/struts/userGuide/struts-bean.html#write) you can
find that it allows formating. Bean:message looks like it does not support
this feature - which kind of makes sense when you consider what its used for
(lookup of strings in the resources -> supporting parameterized
replacement).

The format of the format string is something like

<snip>
  -  <tr>
  -   <td><%= pageContext.getAttribute("test7.value") %></td>
  -    <td>[#,000.00] <bean:write name="test7.value"
format="#,000.00"/></td>
  -    <td>[<bean:message key="format.pattern" />] <bean:write
name="test7.value"
formatKey="format.pattern"/></td>
  -  </tr>
</snip>

The preceeding code came from
http://www.mail-archive.com/[EMAIL PROTECTED]/msg20743.html

Andreas

-----Ursprungliche Nachricht-----
Von: Kumar M [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 11. Marz 2004 16:45
An: Struts Users Mailing List
Betreff: bean:message format ssn



Hi all,

I am wondering if there is an easy way to format the ssnn. What I have
is a String '123456789' but the users would like to see '123-45-6789'.
Is there an easy way of doing this using bean:write or bean:message or
any other tag?

Thanks!!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to