Remote Service Generated Code

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Remote Service Generated Code

Postby michael » Tue Sep 25, 2007 4:58 am

Using GWTDesigner if I create a remote service named TestRS, this is the code that gets generated for client/TestRS.java:

Code: Select all
package com.mycompany.gwt.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface TestRS extends RemoteService {
   /**
    * Utility class for simplifying access to the instance of async service.
    */
   public static class Util {
      private static TestRSAsync instance;
      public static TestRSAsync getInstance(){
         if (instance == null) {
            instance = (TestRSAsync) GWT.create(TestRS.class);
            ServiceDefTarget target = (ServiceDefTarget) instance;
            target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/TestRS");
         }
         return instance;
      }
   }
}


I believe there's an issue w/ this line:
Code: Select all
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/TestRS");


According to the documentation for GWT.getModuleBaseURL(), the url is guaranteed to end with a slash. So the generated code will create a url that looks like this:

http://server:port/module//TestRS

Now, this works fine on TomCat and JBoss. However, WebSphere complains about the double slash before TestRS. I believe the correct code for GWTDesigner to generate should be this:

Code: Select all
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "TestRS");


Curious what others think. Am I right about this one?
-Michael
michael
 
Posts: 14
Joined: Tue Jan 23, 2007 9:06 am
Location: New Jersey

Re: Remote Service Generated Code

Postby Eric Clayberg » Tue Sep 25, 2007 5:40 am

This has been changed in the latest build. Give it a try.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby michael » Tue Sep 25, 2007 10:50 am

Thanks for the quick reply. The 9/25 daily build of windowbuilderpro fixes this. Thanks for the quick fix.
-Michael
michael
 
Posts: 14
Joined: Tue Jan 23, 2007 9:06 am
Location: New Jersey

Postby Eric Clayberg » Tue Sep 25, 2007 11:03 am

michael wrote:The 9/25 daily build of windowbuilderpro fixes this. Thanks for the quick fix.

That's good news.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests