When I try to print the variable that I have autowired, it prints "null" instead of the value I set it to, "Example." I can't quite figure out what I'm missing
In my AppConfig class I have:
@Configuration
public class ApplicationConfiguration {
@Bean
public String tableName(){
return "Example";
}
}
In my other class, DAOMethods, that I want to autowire the variable in:
@Component
public class DAOMethods {
@Autowired
private String tableName;
public void print(){
System.out.println(tableName);
}
}