I made something like that in a servlet:

I have this method in my servlet:

private boolean isDevelopment() {
        return ( SystemProperty.environment.value() ==
SystemProperty.Environment.Value.Development );
}

so you can do something like this:

String redirectUrl = "/MyApp.html";

if (isDevelopment()) {
  redirectUrl += "?gwt.codesvr=127.0.0.1:9997";
}

resp.setContentType("text/plain");
resp.sendRedirect(userService.createLoginURL(redirectUrl));

On 21 oct, 12:16, David Chandler <drfibona...@google.com> wrote:
> A possible workaround is to use GWT.isProdMode() and manually append
> the codesvr URL.
>
> HTH,
>
>
>
> On Thu, Oct 21, 2010 at 10:17 AM, BrianP <brifo...@gmail.com> wrote:
> > I've run into the same problem.  I'm running in dev mode at
> >http://127.0.0.1:8888/mypage.jsp?gwt.codesvr=127.0.0.1:9997but
> > GWT.getHostPageBaseURL() returnshttp://127.0.0.1:8888/and so I am
> > redirected there.  Is there any way to detect dev mode and append my
> > info, or have GWT.getHostPageBaseURL() return a dev mode url?
>
> > On Sep 3, 9:13 am, moriones <avo...@gmail.com> wrote:
> >> i get more or less the behaviour described in the quoted message (gwt
> >> 2.0.4, appengine 1.3.7)
>
> >> when I return from login the application works but i cannot see what i
> >> send to the console with System.out, i cannot debug,
> >> I suppose this is because of the wrong urlhttp://127.0.0.1:8888/
>
> >> the system.out worked just one time after i made a 'gwt compile' (but
> >> the debug still didn't work)
>
> >> ---------- Forwarded message ----------
> >> From: Billy <billy_turc...@hotmail.com>
> >> Date: 19 Mag, 02:55
> >> Subject:createLoginUrlnotworkingin gwt dev mode - loses
>
> >> gwt.codesvr parameter
> >> To: Google Web Toolkit
>
> >> I have an application using GWT and AppEngine (more or less following
> >> the StockWatcher tutorial) which I access locally as:
>
> >>http://127.0.0.1:8888/mypage.jsp?gwt.codesvr=127.0.0.1:9997
>
> >> I am creating a login url using:
>
> >> userService.createLoginURL(requestUri)
>
> >> where requestUri is passed to my server-side login service from my
> >> entry point as: GWT.getHostPageBaseURL().
>
> >> After logging in I am redirected tohttp://127.0.0.1:8888/
>
> >> This loses the dev mode parameter gwt.codesvr and thusly this redirect
> >> only works after I have a done a "GWT compile".
>
> >> (This is using GWT SD 2.0.3 and App Engine SDK 1.3.3)
>
> >> Is it possible to use thecreateLoginUrlfunctionality while remaining
> >> in dev mode?
>
> >> Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-tool...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-web-toolkit+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> David Chandler
> Developer Programs Engineer, Google Web 
> Toolkithttp://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to