Hi All

>From looking in the archives (and not finding what I was looking for)
I have a feeling I may be about to open a can of worms and possibly
leave myself open to abuse. Please go gently with me.

I've managed to get GWT integrated into Spring MVC when deployed to a
real tomcat server. I've configured web.xml to redirect urls to Spring
and then an MVC class passes back my GWT page as a view. It works
well! But not in hosted mode.

This is how I've got the hosted mode
(<project>\tomcat\webapps\ROOT\WEB-INF) web.xml configured:

        <listener>
                
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        
        <servlet>
        <servlet-name>shell</servlet-name>
        
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        </servlet>
        
        <servlet-mapping>
                <servlet-name>shell</servlet-name>
                <url-pattern>/*</url-pattern>
        </servlet-mapping>

and the shell-servlet.xml looks like this:

<bean name="gwtShellServlet" class="co.uk.marauder.SpringGWTShellServlet"/>
    <bean name="messageImpl" class="co.uk.marauder.server.MessageImpl">
        <constructor-arg value="What's up doc?"/>
    </bean>

     <bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                <property name="mappings">
                        <map>
                                <entry key="/co.uk.marauder.MyApplication/**/*"
value-ref="gwtShellServlet" />
                                <entry 
key="/co.uk.marauder.MyApplication/rpc/Message"
value-ref="messageImpl" />
                        </map>
                </property>
        </bean>


SpringGWTShellServlet basically takes GWTShellServlet and makes it
into a Spring Controller:

public class SpringGWTShellServlet extends GWTShellServlet implements
Controller, ServletContextAware
{
        private static final long serialVersionUID = 6499284524261360631L;
        
        private ServletContext servletContext;
        
        @Override
        public ModelAndView handleRequest(HttpServletRequest
request,HttpServletResponse response) throws Exception
        {
                this.doPost(request, response);
                return null;
        }       

        @Override
        public void setServletContext(ServletContext servletContext)
        {
                this.servletContext = servletContext;
        }

        @Override
        public ServletContext getServletContext()
        {
                return servletContext;
        }

}

It works if I have a simple RPC service interface (e.g. a single
method that returns a string), but anything more complicated, like
passing back a List of user defined objects doesn't.

In both cases I get the error:

[INFO] StandardContext[]ERROR: The serialization policy file
'/co.uk.marauder.MyApplication/5BA8A5B3E35F40698BB0BF65F390BCF2.gwt.rpc'
was not found; did you forget to include it in this deployment?

[INFO] StandardContext[]WARNING: Failed to get the SerializationPolicy
'5BA8A5B3E35F40698BB0BF65F390BCF2' for module
'http://localhost:8888/co.uk.marauder.MyApplication/'; a legacy, 1.3.3
compatible, serialization policy will be used.  You may experience
SerializationExceptions as a result.

I'm assuming my problem is that my server side RPC class is no longer
accessed via GWTShellServlet...?

Has anyone else tried this or know how I can fix it? Or do I have the
wrong approach?

-- 
Thanks
Paul

Paul Grenyer
e: [email protected]
w: http://www.marauder-consulting.co.uk
b: paulgrenyer.blogspot.com

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to