GWT Eclipse Hosting mode relative path issue

419 views
Skip to first unread message

San

unread,
Mar 8, 2010, 9:29:14 PM3/8/10
to Google Web Toolkit
Hello,

I use Eclipse 3.5 (Galileo) and google plugin to develop my project.
I'm having an issue while accessing static files from content root
directory in runtime
.

I have placed a xml file - packages.xml under war folder where my
module index html file resides. I'm trying to get the xml file from
the server in runtime and then need to do some parsing

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,
"packages.xml");

But, I'm getting 404 when the above file is access in hosting mode,
but works fine after compilation. When I use "/" prefixed to the xml
file, like "/packages.xml" that works in hosting mode, but it will not
work after compilation. What should I do make it work in hosting mode
and after compilation?. Please advise me. Thanks

Chris Lercher

unread,
Mar 9, 2010, 4:04:36 AM3/9/10
to Google Web Toolkit
Hi,

you should be able to use GWT.getModuleBaseURL() or maybe in your case
GWT.getHostPageBaseURL()

Chris

San

unread,
Mar 9, 2010, 8:35:14 AM3/9/10
to Google Web Toolkit
Thanks, GWT.getHostPageBaseURL helps.
Reply all
Reply to author
Forward
0 new messages