开发者

Different ways to use properties file in j2ee app

I have a j2ee app using Struts2. I have a gloabl properties file which is declared in struts.properties which resides in WEB-INF/classes. It has the following setting:

struts.custom.i18n.resources=mypropertyfile

mypropertyfile also resides in WEB-INF/classes

Say for example it contains the following:

pdf.test.title=PDF Test

then on jsp I use the following to make use of the property file

<s:text name="pdf.test.title"/>

This setup was working on Sun App server 8.2 but is not working on GlassFish App Server (I see pdf.test.title on the browser rather than PDF Test). I 开发者_JAVA百科do not have access to GlassFish App server to try and tweak the setting to make it work. So I want to make changes to the code and see if that will help.

My question is:

What are some other ways to use properties file in a J2EE app? (using Struts2 or not). I'm also open to ways suggested to make changes on glassfish to make this work?

Build/version #'s

GlassFish = 9.1_02 (build b04-fcs)

Struts2 = 2.0.6

JRE6


Try changing your code to use "property" instead of "name":

<s:text property="pdf.test.title"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜