Thursday, October 15, 2009

Re: GWT 2.0: development mode without gwt.hosted in URL

Given that the other apps which you are communicating with are out of your control, and that the issue you are experiencing is during development/testing your best route may be to mock up test servers that replicate the interfaces you are integrating with. These mocks would not only be able to pass the gwt.hosted params back to your app (thus maintaining your debugging state), they could also be constructed such that they facilitate some amount of automated testing. 

Once developed and tested, you'll drop the gwt.hosted param and re-point your app to the live servers that you are integrating with.

- Chris

On Thu, Oct 15, 2009 at 8:07 AM, Ian Bambury <ianbambury@gmail.com> wrote:
As a workaround, you might be able to get your app to check if it's in dev mode and if it is, use JSNI method to get all the anchor tags and convert them.

Ian

http://examples.roughian.com


2009/10/15 itsnotme <luciano@virgilio.it>


Hi Chris,

thank you for your answer. I was talking about links that are out of
GWT control. I understand that most apps do not need this, but I'm
exactly in that corner case. Since my app is going to be integrated in
pre-existing web applications, every time a new page is called, the
hosted mode is lost and the only thing I can do is to manually add the
parameter in the browser bar each time. Wouldn't a web.xml servlet
configuration parameter be enough to change from development to
production mode? In development mode a header might be added to each
response, thus allowing the browser to know that we are in dev mode.

On 14 Ott, 18:18, Chris Ramsdale <cramsd...@google.com> wrote:
> For now the gwt.hosted parameter is the "glue" that allows the browser
> plugin and your IDE to communicate. There are a couple of methods for
> handling this parameter in such a way that the same code works in
> development and web mode.
> *In the current MS1 build:*
>
> String gwtHostedIp = Window.Location.getParameter("gwt.hosted");
>
> String newUrl = Window.Location.getProtocol() + "//" +
> Window.Location.getHost() + "/newPage.html";
>
> if (gwtHostedIp != null && !gwtHostedIp.equals("")) {
>
>   newUrl += "?gwt.hosted=" + gwtHostedIp;
>
> }
>
> Window.Location.replace(newUrl);
>
> *In the upcoming MS2 build:*
>
> import com.google.gwt.http.client.UrlBuilder;
> *
> UrlBuilder builder =
> Window.Location.createUrlBuilder().setPath("/newPage.html");
> *
> *
>
> Window.Location.replace(builder.buildString());
>
> In the MS1 example you will need to preserve any query parameters that you
> want to pass on to the new page (just as you would be doing with the
> gwt.hosted parameter). Using the MS2 UrlBuilder class these parameters will
> be preserved for you.
>
> - Chris
>
> *
>
>
>
> On Tue, Oct 13, 2009 at 5:37 AM, itsnotme <luci...@virgilio.it> wrote:
>
> > Hi,
>
> > I'm developing a GWT 1.7 app that must be able to work in any website.
> > I tried to switch to 2.0 milestone 1, but the new dev mode requires
> > gwt.hosted in the URL. This is an issue for me since every time I
> > change page in the test site, I loose the gwt.hosted parameter.
>
> > Is there really no other way to pass that parameter to the browser
> > plugin? I know that it is not a problem for most GWT apps that just
> > need a URL to load a page that will host the GWT module, but some
> > other apps might be affected by this change.
>
> > In the meanwhile, I'm sticking with 1.7, although the new dev mode
> > definitely rocks.






--~--~---------~--~----~------------~-------~--~----~
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-toolkit@googlegroups.com
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate