Its not working.. I donīt want to insert the code inside the getter method, because it is presentation not business.
<bean:write name="unidade" property="foneCom1" format ="(###)###'-'####"/>
foneCom1 is a String.
There's no straightforward way to do this because Java's MessageFormat classes are oriented towards replacing tokens with object values. One could come up with a MessageFormat template that used the elements of a String array, but it wouldn't work smoothly with a single String property.
Faced with a similar problem, I wrote a custom tag of my own that took a regular expression pattern to break the phone number into a String array, and then a standard MessageFormat template which would be populated with a String array composed of the "match groups" returned by the regex.
You might be able to figure out a way to do something like it using the Jakarta RegExp tag library:
http://jakarta.apache.org/taglibs/doc/regexp-doc/index.html
Best, Joe
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place."
- Carlos Santana