Deprecated url syntax

15 views
Skip to first unread message

dukha

unread,
Apr 12, 2007, 4:27:47 AM4/12/07
to Google Web Toolkit
Hi Guys,
A newbie needs a little help with servlet path (I apparently picked an
tutorial based on an earlier version of gwt:)

Using hosted mode I began with (in the App)

ServiceDefTarget endpoint = (ServiceDefTarget)todoListBackupService;
endpoint.setServiceEntryPoint("/todoListBackupService");

and likewise in the ...gwt.xml

<servlet path="/todoListBackupService"
class="anicca.gwt.todo.server.TodoListBackupServiceImpl"/>

It didn't run and tells me that I need to use GWT.getModuleBaseURL()

I do that as

endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "/
todoListBackupService");

Now it runs but still tells me I'm using a deprecated syntax for the
server path and advised me to use GWT.getModuleBaseURL(). What
gives??

kind regards

Mark

Reinier Zwitserloot

unread,
Apr 12, 2007, 10:59:18 AM4/12/07
to Google Web Toolkit
Simple answer: Ignore the warnings.

Complicated answer: employ the servlets under /your.module.name/
SomeServletName.

Dan Morrill

unread,
Apr 12, 2007, 11:19:42 AM4/12/07
to Google-We...@googlegroups.com
Hi, dukha!

The GWT.getModuleBaseURL() method returns a trailing slash in current versions.  If your module base is /foo, then your code will result in this URL path:  /foo//todoListBackupService

The code is detecting the double-slash.  Try using GWT.getModuleBaseURL() + "todoListBackupService" instead and see if the warning goes away.

Hope that helps!

- Dan Morrill

dukha

unread,
Apr 12, 2007, 8:19:09 PM4/12/07
to Google Web Toolkit
Hi Dan, Reiner, Others,
Thanks for your replies. Unfortunately the only one that worked is
"ignore".
GWT.getModuleBaseURL() + "todoListBackupService" works but still gives
me the deprecation warnings.

Maybe I misunderstood Reiner's suggestion but I tried

<servlet path="/anicca.gwt.todo.client.TodoApp/todoListBackupService"
class="anicca.gwt.todo.server.TodoListBackupServiceImpl"/>

instead of

<servlet path="/todoListBackupService"
class="anicca.gwt.todo.server.TodoListBackupServiceImpl"/>

and giving the full app path bombed (forget the deprecation:
"OnFailure() fired on the Async callback.)

The must be a straight forward syntax for declaring a servlet (that
isn't deprecated according to gwt 1.3)

any help appreciated

Kind regards

mark


On Apr 13, 1:19 am, "Dan Morrill" <morri...@google.com> wrote:
> Hi, dukha!
>
> The GWT.getModuleBaseURL() method returns a trailing slash in current
> versions. If your module base is /foo, then your code will result in this
> URL path: /foo//todoListBackupService
>
> The code is detecting the double-slash. Try using GWT.getModuleBaseURL() +
> "todoListBackupService" instead and see if the warning goes away.
>
> Hope that helps!
>
> - Dan Morrill
>

dukha

unread,
Apr 12, 2007, 8:34:40 PM4/12/07
to Google Web Toolkit
Hi Guys
Well actually Dan's suggestion did work... I just had the same code in
2 places. Oops: very naughty of me. Never again. !

thanks for the help
regards

Mark

Reply all
Reply to author
Forward
0 new messages