Reputation: 8387
My non-controller class:
public class Authorization {
String licensePath ;
@Value("${licenseKeyNotFound}")
String licenseKeyNotFound;
public boolean checkIn(String licensepath) {
System.out.println("hello "+licenseKeyNotFound);
licensePath = licensepath;
return checkIn();
}
}
Here is my properties file:
licenseKeyNotFound = License File Corrupted
My login-servlet.xml
:
<context:property-placeholder location="conf/LicenseSettings.properties"
order="2" ignore-unresolvable="true" />
I didn't put it in the applicationcontext.xml
. Is that right?
Upvotes: 0
Views: 359
Reputation: 1
I think your problem that you put this in the servlet.xml
but should in the spring config a applicationContext.xml
<context:property-placeholder location="conf/LicenseSettings.properties"
order="2" ignore-unresolvable="true" />
Upvotes: 0
Reputation: 62593
I think Spring hasn't found the location location="conf/LicenseSettings.properties"
and because you have set ignore-unresolvable="true"
it isn't complaining about it.
Try putting the files in classpath and use classpath:LicenseSettings.properties
or use an absolute path.
Upvotes: 1