How can I change the servlet-pattern for a GWT project

52 views
Skip to first unread message

mgkind

unread,
Apr 23, 2012, 2:40:07 PM4/23/12
to Google Web Toolkit
Hi
I need to change the default servlet-mapping in my GWT project.
for example when I create a GWT project in eclipse it makes the url
patter of the GWT servlet in (web.xml file) based on the name of the
project; and the clients RPC request are set to go that url I guess!
But for some reason I would like to change the url-pattern of the
servlet (because of deployment issues). So the problem is when I
change that I need to change something in the client that all requests
refer to the new adress.

Do I need to set something in gwt.xml file ?! it seems that there
should be some simple way somewhere to do this setting! I don't know
where I should indicate this.
Can anybody help me on that please.

Thanks

Jens

unread,
Apr 24, 2012, 10:15:54 AM4/24/12
to google-we...@googlegroups.com
Normally you would have a @RemoteServiceRelativePath annotation on your GWT-RPC service. This tells the generated RPC classes to access the service under GWT.getModuleBaseURL() + RemoteServiceRelativePath#value(). If you are not fine with this default structure you can remove the annotation and after you have GWT.create'd the service just cast it to ServiceDefTarget and call setServiceEntryPoint(...) to set a custom path.

If you use RequestFactory you have to create a sub class of DefaultRequestTransport, overwrite getRequestUrl() and initialize your RequestFactory with this custom RequestTransport.

-- J.
Reply all
Reply to author
Forward
0 new messages