File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebApplicationContext.getBean() is not giving bean object?

 
selva raja
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to access bean that defined in context-servlet.xml file and this file is configured in web.xml as
<servlet>
<description>context servlet</description>
<display-name>context</display-name>
<servlet-name>context</servlet-name>
<servlet-class> org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</paramname>
<param-value>/WEB-INF/context-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
i am using Spring-Version: 2.0.6
once i access bean using below line of code
WebApplicationContextUtils.getWebApplicationContex t(request.getSession().getServletContext()).getBea n("bean name") it returns null....

Thanks,
SR
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic