Results 1 to 2 of 2

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

  1. #1
    Join Date
    Jul 2005
    Posts
    1

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    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.

Similar Threads

  1. Auto incrementing keys
    By caverns in forum Data
    Replies: 2
    Last Post: Sep 12th, 2005, 05:23 AM
  2. Auto Proxy
    By drrs in forum AOP
    Replies: 3
    Last Post: Aug 23rd, 2005, 03:17 AM
  3. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  4. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM
  5. Inject Dependencies to a Stateless Session Bean.
    By maramonar in forum Container
    Replies: 2
    Last Post: Sep 14th, 2004, 09:10 AM

Posting Permissions

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