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
Try with constructor injection instead:
import javax.inject.Inject;
import play.Configuration;
import play.Logger;
public class Zipper {
private Configuration configuration;
@Inject
public Zipper(Configuration config) {
this.configuration = config;
}
public void unZip(String zipFilePath) {
Logger.debug("Display : zipFilePath"+zipFilePath);
Logger.debug("before call parameter from application.conf");
Logger.debug("configuration.getString = "+configuration.getString("Unzipedfile.path"));
Logger.debug("aftercall parameter from application.conf");
}
}
I'm not sure that Guice is capable of inject private
fields. Anyway, constructor injection is the recommended injection type.