java - Spring: - How can we get Bean if context are loaded from web.xml? -
i learning spring
being used in project.i found contextconfiglocation
entry in web.xml
/web-inf/context/*-context.xml classpath:/context/database-context.xml classpath:/context/database-service-context.xml classpath:/context/business-process-management-service-context.xml
and listener
<listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener>
in core project read below
resource r=new classpathresource("applicationcontext.xml"); beanfactory factory=new xmlbeanfactory(r); employee s=(employee)factory.getbean("e");
but not figure out how things working , getbean()
function called ?
you can retrieve webcontext method:
Comments
Post a Comment