Results 1 to 2 of 2

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

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    1

    Default 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. #2
    Join Date
    Dec 2011
    Posts
    7

    Default

    Sorry sir I do not know I am so sorry
    Thank you

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •