Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaytag titleKey not fetching values from .properties file

 
Ajay Kamble
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a simple Servlet/JSP/JSTL project deployed on WebSphere 6.1.

I am using displaytag to do pagination. I want to assign column titles from resource bundles, hence I used titleKey attribute, but for some reason the values are not displayed.

Here is my displaytag code


Here is how I am setting my resource bundle (JSTL way),


My column titles just show Capitalized property names, that is title key is not working. But my JSTL fmt messages are properly displayed.


My properties file name is ApplicationResources_en.properties.

Can anyone please suggest why titleKey is not working here?

Regards,
Ajay

 
Dilip Natarajan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran into a similar problem
I use an Spring/Struts application

1)the solution will be to add the Displaytag.properties to classpath say if you use an IDE add it to Src directory or if you are using a build script make it to fall in the classes directory

2) Displaytag.properties should have this entry

Struts: (say you are using a Applicationresources.properties)
locale.provider=org.displaytag.localization.I18nStrutsAdapter

similar way for other frameworks

Hope this helps others too who are facing this
 
Urmi Garad
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I was also facing this problem for Struts2 web application. Please use following steps to solve your problem

1) The solution will be to add the displaytag.properties to the path where ApplicationResource.properties is saved

2) displaytag.properties should have the below lines


3) Copy the below code to a new java class "I18nStruts2Adapter" at "com.web.displaytag.resourceslookup"(package path can be change as per your package structure) in your project.


Hope this will helps to other struts2 user who are facing this problem. Happy Coding !!!
 
mehdi chorsi
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Urmi Garad
I'm new in struts2 and I did all things as you said but still doesn't work form

!!! can you help me?

Is anythings else to do ???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic