I think overriding RemoteServiceServlet.doSerializationGetPolicy
method might help. Anyways, interesting read on this topic are

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/c5f77dee8cc3ddb3
http://code.google.com/p/google-web-toolkit/issues/detail?id=1863&q=rpc&sort=-type


On Nov 5, 9:01 pm, Saurabh <[email protected]> wrote:
> Sri
> So consider the scenario where I have two WAR files: First WAR file
> contains the RPC service and the contextpath is /allservices and
> Second WAR file contains all the generated module code+a-whole-lot-of-
> other-stuff. Second WAR file has a context /mycontent The GWT
> generated JS is being served from the second WAR file.
>
> The problem that I am facing is that when I get the service using
> GWT.create and then modify the ServiceDef using
> ServiceDefTarget.setEntry...
>
> I then run into seriliazation issues. Root cause of this issue is that
> when an RPC call is being made from WAR2 to WAR1 RPC service, the
> moduelBaseURL is different from the contextPath. There is line in
> RemoteServiceServlet that goes like this:
>
> if (modulePath == null || !modulePath.startsWith(contextPath))
>
> This check ensures that RPC WAR cannot be separate from rest of the
> module. modulePath which is moduleBaseURL passed in the RPC request is
> not the same as contextPath. That is always going to be the case,
> unless there is an explict way to configure moduleBaseURL for RPC
> request.
>
> -Saurabh
>
> On Nov 5, 7:15 pm, Sripathi Krishnan <[email protected]>
> wrote:
>
> > You just put a @RemoteServiceRelativePath("/path/to/servlet") annotation in
> > your RPC interface. It just needs the url, not the actual servlet class that
> > is implementing it - so you are still separating the ui code and the server
> > code.
>
> > Or am I completely missing your point?
>
> > --Sri
>
> > 2009/11/5 Saurabh <[email protected]>
>
> > > Even if the RPC Servlets are separate from the UI code, how would you
> > > let your Async service code know the URL of the RPC servlets which may
> > > be deployed in a different tomcat container all together?
>
> > > On Oct 11, 6:35 pm, Sripathi Krishnan <[email protected]>
> > > wrote:
> > > > You should be able to decouple.
>
> > > >    1. Split your code into three logical packages - client, server and
> > > >    shared.
> > > >       - client package has all UI code
> > > >       - shared has the RemoteService and corresponding Async Interfaces,
> > > >       plus any Serializable classes needed  for the communication
> > > > between client
> > > >       and server
> > > >       - server has the RPC Servlets, plus any other code needed for
> > > server
> > > >       components.
> > > >    2. Run GWT on client and shared packages. You may want to include a
> > > >    <source path='shared'/> and <source path='client'/> lines to your
> > > >    module.gwt.xml. Also, during compilation of gwtc, you don't need
> > > >    gwt-servlet.jar in your claspath.
> > > >    3. When you are compiling server side code, make sure to include java
> > > >    files from shared folder. Your classpath should include
> > > gwt-server.jar, but
> > > >    it doesn't need the client side jar files.
> > > >    4. When you bundle your war, gwt-serlvet.jar needs to be present in
> > > the
> > > >    lib folder.
>
> > > > --Sri
>
> > > > 2009/10/9 Chris Ramsdale <[email protected]>
>
> > > > > Uros,
> > > > > If you are using GWT style RPC you won't be able to decouple the
> > > > > client/server relationship as the GWT compiler needs to know about 
> > > > > (and
> > > > > compile) both sides in order for the application to be built. You may
> > > want
> > > > > to take a look at GWT's RequestBuilder class (link below) that allows
> > > you to
> > > > > build GWT based client apps that communicate with a server that may or
> > > may
> > > > > not be GWT based and are ultimately compiled and deployed without
> > > having to
> > > > > do the same with the server.
>
> > > > > RequestBuilder Class
>
> > > > >http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g.
> > > ..
>
> > > > > Thanks,
> > > > > - Chris
>
> > > > > On Wed, Oct 7, 2009 at 1:23 PM, Uros Trebec <[email protected]>
> > > wrote:
>
> > > > >> Hi there!
>
> > > > >> I was wondering if there is in any way possible to package and deploy
> > > > >> GWT-RPC servlet as a stand-alone WAR application, without client side
> > > > >> JS & resources?
>
> > > > >> Basically what I want to do is have a client-side JS & resurces
> > > > >> deployable separately from the servlet, so the servlet application
> > > > >> wouldn't be redeployed every time I compile and deploy generated JS.
>
> > > > >> Any suggestions?
>
> > > > >> Best regards,
> > > > >> Uros
--~--~---------~--~----~------------~-------~--~----~
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