how to use constant string in the resource file.

D

Devendra

Hi all ,

I want to use constant string in the resource file.

I am using JSTL i18N tag library.

Suppose my resource bundle is as follows

resource_english.properties

key1=Some message XYZ
key2=Some Other message XYZ


Now I want to use same XYZ string under some constant. Something as
bellow

KeyConstant=XYZ
key1=Some message + KeyConstant
key2=Some Other message + KeyConstant


I know + sign has no meaning here.
Does any body know how to achieve this?

(I know pros and cons of this very well.
And I also don't want to create composite message something like :
Results {0}-{1} of {2} )

This is really a project need.
 
Z

Zazoun

Devendra said:
Hi all ,

I want to use constant string in the resource file.

I am using JSTL i18N tag library.

Suppose my resource bundle is as follows

resource_english.properties

key1=Some message XYZ
key2=Some Other message XYZ


Now I want to use same XYZ string under some constant. Something as
bellow

KeyConstant=XYZ
key1=Some message + KeyConstant
key2=Some Other message + KeyConstant


I know + sign has no meaning here.
Does any body know how to achieve this?

(I know pros and cons of this very well.
And I also don't want to create composite message something like :
Results {0}-{1} of {2} )

This is really a project need.

Hello,

you can do this at build time, using Ant task "Replace" or
"ReplaceRegExp", for example.
http://ant.apache.org/manual/CoreTasks/replace.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top