I have defined the context params in web.xml
<context-param> <param-name>apikey</param-name> <param-value>45370652</param-value> </context-param> <context-param> <param-name>secretkey</param-name> <param-value>3eada72ef0ae12e15b138ae098c268c087f08ca8</param-value> </context-param> </web-app> I have enabled @Component and @Value annotations in Class and field levels in the bean class. But, it doesn't seem to read them. It is always null
@Component public class TokBoxSettings {
@Value("${apikey}") private String apikey; @Value("${secretkey}") private String secretkey; I have also added the below bean mapping to spring-servlet.xml for configuring PropertyPlaceholder
<bean class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer"> </bean> Please let me know what i have missed
@Configurationannotated classes. Did you try changing@Componentto@ConfigurationforTokBoxSettings? Those two stereotypes may differ in ordering.