This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes displaytag titleKey not fetching values from .properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "displaytag titleKey not fetching values from .properties file" Watch "displaytag titleKey not fetching values from .properties file" New topic
Author

displaytag titleKey not fetching values from .properties file

Ajay Kamble
Ranch Hand

Joined: Jan 23, 2009
Posts: 51
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

Joined: Apr 21, 2011
Posts: 1
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

Joined: Jun 20, 2012
Posts: 3

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

Joined: Jun 05, 2013
Posts: 25
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 ???
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: displaytag titleKey not fetching values from .properties file