You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Besides Bar servlet there two other servlets that work fine, these are Foo and Lorem servlets. I created these two working servlets to verify that @Value annotation works fine when not used directly on servlet (that is the case for Lorem) and in Foo servlet I show that the Properties object is loaded correctly using @Autowired annotation.
So the question is: is it possible to have primitive values from property file directly injected into servlet?
Lukas Vlcek opened SPR-8574 and commented
I am not able to inject primitive values from property file into servlet. Complete sample code can be found here: https://github.com/lukas-vlcek/SpringValueAnnotationTest
In a nutshell:
@Autowired
works fine but using@Value
does not. More specifically see https://github.com/lukas-vlcek/SpringValueAnnotationTest/blob/master/src/main/java/org/test/springframework/inject/Bar.java Injecting using@Value
annotation fails in this servlet.Besides Bar servlet there two other servlets that work fine, these are Foo and Lorem servlets. I created these two working servlets to verify that
@Value
annotation works fine when not used directly on servlet (that is the case for Lorem) and in Foo servlet I show that the Properties object is loaded correctly using@Autowired
annotation.So the question is: is it possible to have primitive values from property file directly injected into servlet?
Affects: 3.0.5
Reference URL: http://forum.springsource.org/showthread.php?112716-Using-Value-to-inject-primitive-value-from-property-file-into-servlet-possible
Issue Links:
@Value
annotation in a Stateless Session BeanReferenced from: commits 8f23c66, 3ffc0a2
The text was updated successfully, but these errors were encountered: