Search code examples
jsppropertiesstruts2locale

How to show values defined in properties file?


I am trying to use locale in my application, I am able to retrieve the values from my properties files.

The problem is that I just want to show the messages but do not know how, I used

    <s:url action="retrieveValues" var="myValues">
        <s:param name="request_locale">val</s:param>
    </s:url>


   <s:label key="mytext"/>

It works but I just need the value of mytext be shown as a single text.

Lets say value of mytext is Hello world when I use the above code it shows

     Hello world: Hello world 

how can I change it to

     Hello World

So it does not show "Hello world:"


Solution

  • if you have a property like following in your property file

    mytext=Hello World
    

    you can use the following in the JSP

    <s:text name="mytext"/>