No erik,
I didn't use any format key bundles as such.
I used the format property and not formatKey.
I don't know how to create a bundle called "TelephoneFormatResources"


<bean:write name="address" property="telephoneno"
format="###-###-#####"/>

This is how I used the bean.

Regards
Krishna Mohan R
 
-----Original Message-----
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 07, 2005 7:24 AM
To: Struts Users Mailing List
Subject: Re: formatting of strings

Are you sure it's not formatKey="format1" instead of 
formatKey="###-##-####"?

For example:

<bean:write name="address" property="telephoneno"
bundle="TelephoneFormatResources" formatKey="format1"/>

(assuming the bundle exists, has the key "format1" which has the value
"###-##-####")

instead of:

<bean:write name="address" property="telephoneno"
bundle="TelephoneFormatResources" formatKey="###-###-#####"/>

Makes more sense to me . . .

Erik


Krishna Mohan Radhakrishnan wrote:

>Sorry Tommy,
>The thing that u said simple didn't not work out..
>Do u have any other ideas.
>
>Are u sure that it is ##### only.
>Or is it any other character..
>
>
>
> 
>INFOSYS TECHNOLOGIES LIMITED
>3rd Floor | "Bhavani" Technopark | Trivandrum  695 581 | India
>Phone +91 471 2700888 Extn 7365 | Mobile: +919895532610
>[EMAIL PROTECTED]| www.infosys.com 
>
>-----Original Message-----
>From: Tommy Holm - TELMORE [mailto:[EMAIL PROTECTED] 
>Sent: Thursday, January 06, 2005 2:59 PM
>To: Struts Users Mailing List
>Subject: SV: formatting of strings
>
>Hi 
>It's actually very simple.
><bean:write name="address" property="telephoneno"
>format="###-###-#####"/>
>A better solution would be to create a ressource bundle - lets say
>TelephoneFormatResources.properties and create an entry in that file-
>something like
>format1=###-###-####
>
>The use the bundle instead
>
><bean:write name="address" property="telephoneno"
>bundle="TelephoneFormatResources" formatKey="###-###-#####"/>
>
>It will then take the format from the bundle instead of the jsp page
>directly. The advantage is that if you change the format, then you just
>have to change it one place, instead of changing the format in all jsp
>pages!
>Cheers
>-----Oprindelig meddelelse-----
>Fra: Krishna Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] 
>Sendt: 6. januar 2005 09:08
>Til: Struts Users Mailing List
>Emne: formatting of strings
>
>Hi all,
>
>I have a class called address. I want to display the the telephone
>number from it.
>The below mentioned is the code. But from the address class we will
>retrieve it as 10 digit string.
>
><bean:write name="address" property="telephoneno"/>
>
>For example if  9845612345 is the number I want to display it as
>follows.
>984-561-2345
>
>Is there any idea of how to format the string in this fashion
>
>Regards,
>Krishna Mohan R
>
>
>---------------------------------------------------------------------
>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]
>
>
>
>
>---------------------------------------------------------------------
>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]




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

Reply via email to