• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with placeholders of Resource Bundle file when upgaraded to Freemarker 2.3.18 jar

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a question regarding Freemarker 2.3.18 jar file.

I am using Struts, and freemarker. I have my messages defined in ApplicationResources.properties file.

Some messages in my properties file have placeholder specified like this

{0} is a template language

I could able to get the message displayed on UI by supplying the value for placeholder with Freemarker 2.3.16 jar file.

${bundle(m.getKey(),m.getValues())}

Where m is a loop Variable of messages (<#assign messages = request.getAttribute("org.apache.struts.action.ACTION_MESSAGE")?if_exists >)
bundle is static ResourceBundleModel rs = new ResourceBundleModel(ResourceBundle.getBundle("ApplicationResources"),new BeansWrapper());
I am populating bundle like this ((SimpleHash) data).put("bundle", rsbm); and here data is a variable of TemplateModel

When I replaced Freemarker 2.3.16 jar file with Freemarker 2.3.18 jar file. I am getting message as,

[Ljava.lang.Object;@12a520b8 is a template language

When I debugged using source code of ResourceBundleModel class in freemarker 2.3.16 & 2.3.18 jar files, the messages which I got are as follows ,

arguments value in
public Object exec(List arguments) method is showing the passed placeholder value as [Ljava.lang.Object;@12a520b8 and

public Object exec(List arguments) method is showing the correct placeholder value like Freemarker

I will be thankful if anyone can help me in solving this issue.

I have posted this question on http://stackoverflow.com/questions/6783393/problem-with-placeholders-of-resource-bundle-file-when-upgaraded-to-freemarker-2

Thanks
Vivek.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic