Results 1 to 5 of 5

Thread: access a spring bean from a servlet

  1. #1
    Join Date
    Sep 2011
    Posts
    4

    Unhappy access a spring bean from a servlet

    Hi I am new in Spring please guide me,
    I want to access spring bean(IOC) from simple servlet .

    Following are the requirements
    1. A spring bean (.xml file) which internally using hibernate to communicate with persistence layer
    2. Want to access that bean from servlet extending HttpServlet
    3. Configuration of web.xml
    4. required jar files.

    Please reply with a small example. Thanks in advance

    Regards
    Neel

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    The reference guide answers that... I suggest a read of that it explains how to use spring in such an environment... One hint WebApplicationContextUtils...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Sep 2011
    Posts
    4

    Default Marten Deinum

    Hi Marten Deinum,
    Can you please give me a small code snipp. It will be helpful to me.

    Thanks

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    As I stated that is all in the reference guide...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Sep 2011
    Posts
    4

    Default Marten Deinum

    Thank you very much . I could overcome the problem.

    Thanks for your quick response.

Posting Permissions

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