Hi,
You can use the Spring listener in the web.xml:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
Then in any of your Servlets you can use the context:
WebApplicationContextUtils.getWebApplicationContext
(getServletContext()).getBean("someBean");
If your looking for a simple way to do this checkout:
http://devbright.com/2009/05/super-simple-gwt-spring-integration/
Gordon
http://devbright.com
On Jul 15, 8:30 am, cristi <[email protected]> wrote:
> I saw a lot of article about integrating GWT RPC and Spring
>
> What do you thing (for begginers) this apporach is not ok ?
>
> In the web xml the application context is loaded via
>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>/WEB-INF/applicationContext.xml</param-value>
> </context-param>
> <servlet>
> <servlet-name>context</servlet-name>
>
> <servlet-class>org.springframework.web.context.ContextLoaderServlet</
> servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> Ok the a regular service is created
> DummyService,DummyServiceAsynch,DummyServiceImpl
>
> DummyServiceImpl extends RemoteServiceServlet
>
> SomeSpringBean someSpringBean;
>
> public void init() throws ServletException {
> super.init();
>
> ApplicationContext appContext =
> WebApplicationContextUtils.getRequiredWebApplicationContext
> (getServletContext());
> someSpringBean = (SomeSpringBean) appContext.getBean
> ("someSpringBean");
>
> }
>
> So in this way i have on server side "kind of injected" a spring bean
> i defined in appContext.xml
>
> I w8 your opinion !
>
> Thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---