RequestBuilder and path problem

16 views
Skip to first unread message

Christopher Z.

unread,
Nov 6, 2009, 9:22:11 AM11/6/09
to Google Web Toolkit
Hello,

I have problem with RequestBuilder. My code:

RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
"/myfile.html");

and when i execute this code, then requestBuilder try to get
myfile.html from http://server/myfile.html

Now is everything ok, but when i deploy project to tomcat, then my
file will be in:

webapps/myproject/myfile.html

but requestBuilder will be try to get in ROOT directory :/

so i've changed to:
RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
"myfile.html");

without "/", but now my hosted mode try to get from http://server/myproject/myfile.html

any idea how to resolve this problem ?

Thanks
Christopher Z.

Yozons Support on Gmail

unread,
Nov 6, 2009, 12:07:13 PM11/6/09
to google-we...@googlegroups.com
I have problem with RequestBuilder. My code:

RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
"/myfile.html");


You might try prepending GWT.getModuleBaseURL()

If it's code in the module base URL, you are golden, and if it's not, you must put a "../" in front typically to go up one level which should be your webapp's context path.


Christopher Z.

unread,
Nov 6, 2009, 3:11:49 PM11/6/09
to Google Web Toolkit
Thank your. works now.

Thomas Broyer

unread,
Nov 6, 2009, 8:07:36 PM11/6/09
to Google Web Toolkit


On 6 nov, 18:07, Yozons Support on Gmail <yoz...@gmail.com> wrote:
> > I have problem with RequestBuilder. My code:
>
> > RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
> > "/myfile.html");
>
> You might try prepending GWT.*getModuleBaseURL*()
>
> If it's code in the module base URL, you are golden, and if it's not, you
> must put a "../" in front typically to go up one level which should be your
> webapp's context path.

Or you use GWT.getHostPageBaseURL()
Reply all
Reply to author
Forward
0 new messages