D
D
Dyupich2021-07-13 20:34:04
Java
Dyupich, 2021-07-13 20:34:04

Problem with context:property-placeholder. It refuses to work. What should I do?

I have a musicPlayer.properties config file. It has the following code.

musicPlayer.name = some namespace
musicPlayer.volume = 70


I establish a connection with the project using the command:

<context:property-placeholder location="classpath:musicPlayer.properties"/>


Then I put the parameters in

<bean id="musicPlayer"

          class="ru.dyupich.course.TheMusicInterfaceRealisation.MusicPlayer">
        <property name="music" ref="musicBean"/>
        <property name="name" value="%{musicPlayer.name}"/>
        <property name="volume" value="%{musicPlayer.volume}"/>
    </bean>


However, the values ​​are not read and are underlined in red (the String value is underlined as normal). How can this be resolved?
I am attaching screenshots below.

60edce077408c992294517.png

60edce19c2cd1889761072.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question