Results 1 to 2 of 2

Thread: in jsp, how to use bean defined in applicationContext.xml

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Posts
    1

    Default in jsp, how to use bean defined in applicationContext.xml

    Say I have test bean defined in <bean id="test" class="Test"/> in applicationContext.xml. Now I'd like to access this bean in my jsp. Somehow <jsp:useBean id="test" class="Test" scope="application"/> creates new instance of Test, not using the singleton Bean test created by Spring.

    How to achieve this goal?

    thanks!

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Chapter 13 in the Spring reference manual discusses JSP and JSTL integration in some detail, plus you can find some great examples of Spring and JSP usage in the sample applications that are included with the distribution. They explain this better than I can here

    Post back if you have no luck.


    Rob

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

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