Fórumok

Is there possible to get the spring context in the servlet

Tony Lu, módosítva 12 év-val korábban

Is there possible to get the spring context in the servlet

New Member Bejegyzések: 4 Csatlakozás dátuma: 2011.05.26. Legújabb bejegyzések
Hi,
I have a spring portlet MVC and a servlet. The servlet (named emns )is loaded by the PortalDelegateServlet.
My question is, how can my emns servlet can access the same application context with the portlet.
Thanks for your comments or suggestion,
Best regards,
tony
thumbnail
David H Nebinger, módosítva 12 év-val korábban

RE: Is there possible to get the spring context in the servlet

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
If you add the spring context loader listener to web.xml, the spring context should be available to the servlet also.
Tony Lu, módosítva 12 év-val korábban

RE: Is there possible to get the spring context in the servlet

New Member Bejegyzések: 4 Csatlakozás dátuma: 2011.05.26. Legújabb bejegyzések
Thanks for the reply,
yea you are right, the problem of my situation is overriding to the wrong servlet init method,
After I change to void init(ServletConfig config) and using the config to get the context object then it works.
Best regards,
tony