Reputation: 12582
I have a HttpServlet inside tapestry project. But I think it is not recognized as a part of IoC. So when I do an @inject
it does not work. It ends up throwing a null pointer exception. Any suggestion about how to inject the same hibernate session.
Upvotes: 2
Views: 272
Reputation: 12582
Inside the servlet doPost() method I did the following.
Registry registry = (Registry)
getServletContext().getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME);
hbSession = registry.getService(Session.class);
Upvotes: 2