PDA

View Full Version : in jsp, how to use bean defined in applicationContext.xml


dwang
Sep 22nd, 2004, 01:55 PM
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!

robh
Sep 22nd, 2004, 03:54 PM
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