Play 2.5.3: Using dependency injection to get configuration values

前端 未结 5 1936
忘了有多久
忘了有多久 2021-02-05 22:59

I\'m trying to migrate a Playframework application from 2.4 to 2.5.3 and I have problems to get values from application.conf file:

Before t

5条回答
  •  逝去的感伤
    2021-02-05 23:27

    I put here the answer, in order to help anyone with the same issue

    My error came from the way i used to instantiate my Zipper java class from my calling class.

    Thx to Igmar Palsenberg, he provided me the answer : https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/play-framework/uLFqTM9_Iy4

    I used Zipper zipTest = new Zipper(); to instanciate my Zipper class and i have to use Zipper zipTest = injector.instanceOf(Zipper.class);

提交回复
热议问题