1

私の非コントローラークラスは、

public class Authorization {
String licensePath ;

@Value("${licenseKeyNotFound}")
String licenseKeyNotFound;

    public boolean checkIn(String licensepath) {
    System.out.println("hello "+licenseKeyNotFound);
    licensePath = licensepath;
    return checkIn();
    }

}

これが私のプロパティファイルです。

licenseKeyNotFound = License File Corrupted

私のlogin-servlet.xml意志は、

<context:property-placeholder location="conf/LicenseSettings.properties"
     order="2" ignore-unresolvable="true" />

私はそれをapplicationcontext.xmlに入れていませんでした。そうですか?

4

2 に答える 2

1

Spring はその場所を見つけていないと思いますlocation="conf/LicenseSettings.properties"。あなたが設定したので、ignore-unresolvable="true"それについて不平を言うことはありません。

ファイルをクラスパスに入れてclasspath:LicenseSettings.properties、絶対パスを使用または使用してみてください。

于 2013-01-23T12:43:30.277 に答える
0

servlet.xmlこれを入れたが、春の設定にすべきだというあなたの問題だと思いますapplicationContext.xml

<context:property-placeholder location="conf/LicenseSettings.properties"
     order="2" ignore-unresolvable="true" />
于 2013-01-23T12:51:48.700 に答える