Questions about the Struts resource bundle

W

William Cole

I am currently building a web application using the Struts framework.
I need to internationalize the site so I am putting all of the
localizable text into the resource bundle. The first question I have
is how can I add a multiple line key value pair? Some of my values in
the properties file are a paragraph long. My next question is about
colons. I am reading "Programming Jakarta Struts" from O'reilly (1st
edition I believe)and on page 294 they talk about how you can use
colons instead of the equal sign. Is there away to escape the colon so
that I could use colons in my value? For example
jsp.index.title=Project Name: Site Introduction

Any help would be appreciated.

</WRC>
 
R

Ryan Dillon

William said:
is how can I add a multiple line key value pair?

Put a "\" at the end of each partial line.
Is there away to escape the colon so
that I could use colons in my value? For example
jsp.index.title=Project Name: Site Introduction

Escape them using "\", for example

jsp.index.title:project Name\: Site Introduction


ResourceBundles load information using a Properties object,
so you can find all this information in the Javadoc for the
Properties.load() method.
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top