Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
roll atwork
Resource bundle in Spring MVC portlet plugin issue
February 23, 2011 11:31 AM
Answer

roll atwork

Rank: Junior Member

Posts: 30

Join Date: October 6, 2004

Recent Posts

Have looked through the forums but have yet to find a helpful suggestion to why the resource bundle is not being picked up in my Spring MVC portlet deployed in 6.0.5:

war contains:

content/Resource.properties with applicable key value pairs

portlet.xml contains:

<resource-bundle>content.Resource</resource-bundle>

Goal is to utilize the ThemeDisplay.translate method, however, even the ResourceBundle.getBundle method is not seeing the Resource.properties file.

Any suggestions?

Thanks,
R
Jignesh Thakkar
RE: Resource bundle in Spring MVC portlet plugin issue
February 23, 2011 7:58 PM
Answer

Jignesh Thakkar

Rank: New Member

Posts: 24

Join Date: May 9, 2010

Recent Posts

Hi Roll

After reading your post, I think you want to fetch the value from properties file.

So, for that Liferay provides us a API to fetch the value from the properties file.

you have to define all the properties value in portal-ext.properties file and you can fetch it using PropsUtil API.

For ex. if you define your properties in portal-ext.properties like abc=roll

and from Java code you have to write this line of code to fetch the value of "abc"

PropsUtil.get("abc");

let me know if you want more information
roll atwork
RE: Resource bundle in Spring MVC portlet plugin issue
February 24, 2011 8:32 AM
Answer

roll atwork

Rank: Junior Member

Posts: 30

Join Date: October 6, 2004

Recent Posts

Thank you for the response.

I may give this a try.

However, my goal is to provide messages via the resource bundle for internationalization purposes. Resource bundle seems to be the preferred way.

I don't think this is something so unique it needs to be in the portal-ext.properties file does it as seems to be addressing a different concern (ie portal configuration v. language translation).

Anyone else see an issue with how I've configured this via my portlet plugin?

Thanks,
Roll
SZ khan
RE: Resource bundle in Spring MVC portlet plugin issue
February 25, 2011 3:13 PM
Answer

SZ khan

Rank: Regular Member

Posts: 148

Join Date: October 31, 2009

Recent Posts

add <supported-locale/> in your portlet.xml
and create the file accordingly
roll atwork
RE: Resource bundle in Spring MVC portlet plugin issue
February 25, 2011 10:48 PM
Answer

roll atwork

Rank: Junior Member

Posts: 30

Join Date: October 6, 2004

Recent Posts

Thank you.

however, the issue actually was related to the fact that I do not think the themeDisplay.translate works in the plugin environment.

by using the resourcebundle.getBundle method and messageformatting it to complete what the themeDisplay.translate was trying to accomplish, I was able to complete the themeDisplay.translate feature.

Thanks,
Roll
Andrés Cerezo
RE: Resource bundle in Spring MVC portlet plugin issue
October 15, 2011 7:08 AM
Answer

Andrés Cerezo

Rank: Junior Member

Posts: 92

Join Date: November 11, 2010

Recent Posts

Hello, I have the same problem with themeDisplay.translate. Did you find the solution?

Thanks.