Questions about the Struts resource bundle

Discussion in 'Java' started by William Cole, Mar 2, 2005.

  1. William  Cole

    William Cole Guest

    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>
     
    William Cole, Mar 2, 2005
    #1
    1. Advertising

  2. William  Cole

    Ryan Dillon Guest

    William Cole wrote:
    > 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.

    --
    Ryan Dillon
    Code Canvas Technologies
    Sign up for the RapidJ beta!
    http://www.codecanvas.com.au/rapidj/
     
    Ryan Dillon, Mar 3, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kent Tong

    i18n using resource bundle

    Kent Tong, Jul 15, 2003, in forum: Java
    Replies:
    2
    Views:
    917
    Kent Tong
    Jul 16, 2003
  2. Mike Landis

    Reloading resource bundle

    Mike Landis, Oct 22, 2003, in forum: Java
    Replies:
    0
    Views:
    456
    Mike Landis
    Oct 22, 2003
  3. Taji

    Resource Bundle

    Taji, Jul 29, 2004, in forum: Java
    Replies:
    1
    Views:
    440
    Roedy Green
    Jul 29, 2004
  4. Replies:
    0
    Views:
    448
  5. Dov MORYUSEF
    Replies:
    2
    Views:
    5,322
Loading...

Share This Page