Announcement Announcement Module
Collapse
No announcement yet.
Using @Value to inject primitive value from property file into servlet possible? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using @Value to inject primitive value from property file into servlet possible?

    Hi,

    Is it possible to use @Value annotation to inject primitive value from property file into servlet? The servlet is not manager by Spring but I use SpringBeanAutowiringSupport.processInjectionBasedO nServletContext(this, config.getServletContext()); to handle autowiring support.

    I created a simple webapp to demonstrate what works and what does not for me:
    https://github.com/lukas-vlcek/Sprin...AnnotationTest

    More specifically, the follwoing servlet does not work for me:
    https://github.com/lukas-vlcek/Sprin...nject/Bar.java

    However, the following servlet does work:
    https://github.com/lukas-vlcek/Sprin...nject/Foo.java

    Which means that the property file is processed by Spring and it should be accessible. But I am getting exception when trying to access and inject the value using @Value("#{ values['one'] }").

    Any ideas?

    Regards,
    Lukas

  • #2
    Sorry sir I do not know I am so sorry
    Thank you

    Comment

    Working...
    X