Window.Location.getParameter() always null

691 views
Skip to first unread message

mdwarne

unread,
Jun 29, 2010, 3:35:32 PM6/29/10
to Google Web Toolkit
Hi,

I need to pass a parameter to my application. However if I append a
parameter to the url query string, I can not retrieve it by name using
Window.Location. (Always returns null)

When I retrieve the entire Query String, It contains only the
gwt.codesvr parameter, but not my additional parameter.

Any Ideas?
Thanks,
Mike.

Stefan Bachert

unread,
Jun 30, 2010, 4:00:10 PM6/30/10
to Google Web Toolkit
Hi,

I use it and it works.
Please supply your URL and your code, probably something went wrong.

Stefan Bachert
http://gwtworld.de

mdwarne

unread,
Jul 1, 2010, 9:10:13 PM7/1/10
to Google Web Toolkit
Hi Stephan,
Thanks for your reply.

I discovered that it works, but not in Developer Host mode (OOPHM).
Maybe the developer plugin strips the params from the url?

my URL is something like this:
http://192.168.0.205:8888/MyApp.html?gwt.codesvr=192.168.0.205:9997&kc=test

I also tried:
http://192.168.0.205:8888/MyApp.html?kc=test&gwt.codesvr=192.168.0.205:9997

My code is simple:

public void onModuleLoad() {
String urlKey = Window.Location.getParameter("kc");
if (urlKey != null) {
// do something special here.
} else {
// default code.
}
}


Thanks,
Mike.

On Jun 30, 10:00 am, Stefan Bachert <stefanbach...@yahoo.de> wrote:
> Hi,
>
> I use it and it works.
> Please supply your URL and your code, probably something went wrong.
>
> Stefan Bacherthttp://gwtworld.de

Stefan Bachert

unread,
Jul 2, 2010, 11:55:36 AM7/2/10
to Google Web Toolkit
Hi Mike,

you code and url looks absolutely correct.
I do the similar within my project and it works.
I am using FF, eclipse, linux. I do not face any problems.

I do not have any idea what went wrong at your site


Stefan Bachert
http://gwtworld.de




On Jul 2, 3:10 am, mdwarne <mike.wa...@gmail.com> wrote:
> Hi Stephan,
> Thanks for your reply.
>
> I discovered that it works, but not in Developer Host mode (OOPHM).
> Maybe the developer plugin strips the params from the url?
>
> my URL is something like this:http://192.168.0.205:8888/MyApp.html?gwt.codesvr=192.168.0.205:9997&k...
>
> I also tried:http://192.168.0.205:8888/MyApp.html?kc=test&gwt.codesvr=192.168.0.20...
Reply all
Reply to author
Forward
0 new messages