I\'m trying to integrate Spring Security and GWT. I\'m also using gwt-incubator-security. I configured everything as it was described on their wiki pages. I managed to get secur
I'am using GWT+Spring security. I find in your configuration, there is some misunderstanding. In fact, there is a very simple way that can let spring security work with your gwt regardless the gwt-incubator-security. You just need to declare your application context in you web.xml.
contextConfigLocation
/WEB-INF/applicationContext-security.xml
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*
org.springframework.web.context.ContextLoaderListener
You don't declare here your MVC dispatcherServlet ! Then everything works because of the Spring Security framework mechanism.
Then if you insist to use gwt-incubator-security. I've read a very good solution in french, but it rest uncheck. http://hugo.developpez.com/tutoriels/java/gwt/utilisation-gwt-avec-spring-et-hibernate/
appService com.google.gwt.app.example.server.AppServiceImpl appService /app/appService
If you like very much Spring, and you want to use DispatcherServlet to dispatch the request, then GWT-handler can help you to get rid of the problem. Firstly, you load application context in the web.xml as below:
contextConfigLocation
classpath:applicationContext_GWT.xml
org.springframework.web.context.ContextLoaderListener
Then you can declare your rpc service in Spring context: applicationContext_GWT.xml
But you should not forget to add the GWTHandler declaration in the application context file applicationContext_GWT.xml
The last thing is to declare the spring servlet: DispatcherServlet in the web.xml. Pay attention to the fact that this is the spring’s proper servlet not the GWT-SL’s.
web.xml
handler
org.springframework.web.servlet.DispatcherServlet
1
handler
*.rpc
Servlet name is important because DispatcherServlet will search for the spring context file named by “*-servlet.xml”. As the servlet name is handler, it will search for the spring context “handler-servlet.xml”. So here we will solve the problem like this, we put the application context which is independent with the DispatcherServlet in the “applicationContext_GWT.xml”, then the one that is dependent with the DispatcherServlet in the “-servlet.xml”, as the servlet name is “handler”, then we should have “handler-servlet.xml”, then put the following configuration of GWT_SL from applicationContext_GWT.xml into handler-servlet.xml Handler-servlet.xml
Then add the following configuration in the web.xml dans la declaration de servlet.
contextConfigLocation
/WEB-INF/handler-servlet.xml
The filter pattern concerns just the RPC call with a suffix .rpc (I didn’t use the GWT-SL, so the method above for integration has not been checked.)
After you have all the above configuration, then you create your filtreprocessentrypoint in your applicationi context file.
Hope this can help you!