开发者

Java String externalization key missing

开发者 https://www.devze.com 2023-01-30 17:47 出处:网络
I used the Eclipse string externalisation wizard to extract strings which are then stored ina configuration file.

I used the Eclipse string externalisation wizard to extract strings which are then stored in a configuration file. Although when I run it I keep getting an NPE whenever a resource or a System.getProperty() is called.

I can't seem to find documentation on this, is there a re开发者_如何转开发ason for this?

Many thanks.


You won't find your externalized through System.getProperty().

From the docs of System.getProperty():

Gets the system property indicated by the specified key.

When I run the String externalization wizzard I get a class called Messages on which I can call a .getString method like this:

Messages.getString("Test.STR0")
0

精彩评论

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