Announcement Announcement Module
Collapse
No announcement yet.
How to auto-inject dependencies into my (Framework)Servlet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to auto-inject dependencies into my (Framework)Servlet

    Hi!
    I would like my servlets to be injected by Spring like any other Java beans that are configured in an application context.
    Currently I have to overwrite initFrameworkServlet and get my dependent beans out of the WebApplicationContext manually.
    Since my servlet has setter methods for each of the needed dependent beans, I would like Spring to fill in the dependencies automatically.

    Before I start to write the code I want to ask if Spring has already some support for this but I just couldn't find it.

    Thanks,
    Robert

  • #2
    When you say "servlets" do you mean spring Controllers or actual HttpServlets?

    If yu are not using Controllers, then I would suggest you do as they would give you exactly what you want.

    Comment

    Working...
    X