I have some Spring beans I need to wire and make available in a web application. I was hoping to just use a regular
Java Http
Servlet and wire up my Spring beans and then access the wired beans from the regular Java Servlet.
However, now that I've got the DispatcherServlet wired and Spring says it's setup all my beans, when I try to use the beans from a regular Servlet, none of the beans are wired. I'm getting NullPointerExceptions for properties not injected.
Therefore, when you use DispatcherServlet, is it then necessary to use Spring-MVC to then be able to access the wired beans you've set up or can I access them in a regular Servlet I've defined? So far, the regular Servlet route doesn't appear to work and, in the debugger, there aren't any obvious "context" objects.
Maybe I'm answering my own question here, but I'm not quite sure if there isn't a slick way to access the wired beans without full-blown MVC. I don't need a form. I just need to return a value from a wired bean that connects to other beans, etc., in a web context.
Thanks in advance for any replies.
- mike