Announcement Announcement Module
No announcement yet.
Initializing Application scoped bean in Spring MVC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Initializing Application scoped bean in Spring MVC

    Hello All,

    I want to initialize a bean or an ArrayList like a list of key value pairs for all the drop downs in the application that can be used across sessions application wide. And Want to happen during the application start-up. I tried implementing the ServletContextListener and added the beans to the context, but it didn't work.

    Any suggestions as to how I can achieve this. Thanks.


  • #2
    Why not simply add them to the ApplicationContext and retrieve them from the context...


    • #3
      Thanks Marten. Can you point me to a Sample code. I tried implementing ApplicationContextAware, i guess that is wrong interface to Implement. I also tried implementing ServletContextAware, and it worked but only thing was I was not able to hit the database (using hibernate), it complained that no transaction was found even though I annotated the method with @Transnational. Any ideas as to what might be going wrong here. Thanks.