I can't reach my daos in any other way but using
ApplicationContext context =
WebApplicationContextUtils.getWebApplicationContext(getServletContext());

I've tried using some spring annotations and <context:annotation-config />
to autowire these daos into the servlet.
When not using @Qualifier spring would fail at startup telling me that I'm
not specific enough and that there are 20 more beans of that type "IDAO"
which is correct.
when using @Qualifier spring does not fail at startup but doesn't
successfully inject the dao - I get Null instead of the dao.

Then I've tried using only xml config approach - defining the servlet as a
bean in applicationContext.xml and referencing its dao property to the
correct bean prop.
Again i get Null instead of the dao.

I've tried googling for a solution but couldn't find one. I only learned
that the problem is probably that the servlet is outside of the web
application context so it can't reach
beans defined in it by simple xml property ref config.

This isn't wicket specific problem, but any help as to how I can use a
xml/annotation configuration instead of directly setting the daos in the
servlet's init() would be greatly appreciated!

Thanks
-Sam

Reply via email to