Google Groups Home
Help | Sign in
GWT.getModuleBaseURL() in 1.1 with -noserver option
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Gunnar Wagenknecht  
View profile
 More options Aug 15 2006, 1:35 pm
From: "Gunnar Wagenknecht" <eclipseg...@gmail.com>
Date: Tue, 15 Aug 2006 10:35:37 -0700
Local: Tues, Aug 15 2006 1:35 pm
Subject: GWT.getModuleBaseURL() in 1.1 with -noserver option
Hi!

GWT 1.1. removed the need for a gwt-hosted.html file. In my projects
GWT.getModuleBaseURL()  now returns an empty string when used in hosted
mode with the -noserver option. The compiled code works fine in the
browser it just doesn't work in the development shell started with the
"-noserver" option.

Is this a known issue or is there a configuration workaround?

Cu, Gunnar


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hovan  
View profile
 More options Aug 15 2006, 2:18 pm
From: "hovan" <huongho...@gmail.com>
Date: Tue, 15 Aug 2006 11:18:48 -0700
Local: Tues, Aug 15 2006 2:18 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
Gunnar,

It's not a bug at all. It took me almost 1 hour to figure things out.
To run in -noserver mode:

1. Don't do any <servlet> mapping in .gwt.xml file or mapping without
module name

2. web.xml have to map with module name (something like
/modulename/servicename)

3. service end point must include: getModuleBaseURL() + servicename

Thanks,
hovan.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gunnar Wagenknecht  
View profile
 More options Aug 15 2006, 2:31 pm
From: "Gunnar Wagenknecht" <eclipseg...@gmail.com>
Date: Tue, 15 Aug 2006 11:31:50 -0700
Local: Tues, Aug 15 2006 2:31 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
hovan schrieb:

> It's not a bug at all. It took me almost 1 hour to figure things out.
> To run in -noserver mode:

Hoven, that's not my problem.

GWT.getModuleBaseURL() in hosted with -noserver  !=
GWT.getModuleBaseURL() in compiled mode

So, the resource or service works using the compiled JavaScript but not
in the hosted browser. For example, new Image(GWT.getModuleBaseURL()  +
"/myimage.png") works perfect in the compiled version but does not work
in the hosted browser (because GWT.getModuleBaseURL()  in an empty
string there).

Cu, Gunnar


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hovan  
View profile
 More options Aug 15 2006, 4:06 pm
From: "hovan" <huongho...@gmail.com>
Date: Tue, 15 Aug 2006 13:06:02 -0700
Local: Tues, Aug 15 2006 4:06 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
For the images go with module, it's better to put in public folder and
use path without module name.
so just use /myimage.png.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gunnar Wagenknecht  
View profile
 More options Aug 15 2006, 4:09 pm
From: "Gunnar Wagenknecht" <eclipseg...@gmail.com>
Date: Tue, 15 Aug 2006 13:09:09 -0700
Local: Tues, Aug 15 2006 4:09 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
They are in the public folder and they do work in compiled mode. But
anyway, anything that relays on GWT.getModuleBaseURL() is broken in
hosted mode with -noserver option for me and I'm trying to find out why
GWT.getModuleBaseURL() returns an empty string there.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hovan  
View profile
 More options Aug 15 2006, 4:24 pm
From: "hovan" <huongho...@gmail.com>
Date: Tue, 15 Aug 2006 13:24:20 -0700
Local: Tues, Aug 15 2006 4:24 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
It works just fine for me on, hosted with or without -noserver and in
compiled mode. Because of something like this in .nocache.html
function onLoad() {
  if (!$wnd.__gwt_isHosted) return;
  if (!$wnd.__gwt_isHosted()) {
    selectScript();
  }
  else {
    var mcb = $wnd.__gwt_tryGetModuleControlBlock(location.search);
    if (mcb) {
      $moduleName = mcb.getName();
      $moduleBaseURL = mcb.getBaseURL();
      mcb.compilationLoaded(window);
    }
  }
}

I guess.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gunnar Wagenknecht  
View profile
 More options Aug 15 2006, 4:28 pm
From: "Gunnar Wagenknecht" <eclipseg...@gmail.com>
Date: Tue, 15 Aug 2006 13:28:45 -0700
Local: Tues, Aug 15 2006 4:28 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
Yes, this worked for me before. But now with 1.1. it stopped working.
What arguments do you use when launching the development shell?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hovan  
View profile
 More options Aug 15 2006, 4:37 pm
From: "hovan" <huongho...@gmail.com>
Date: Tue, 15 Aug 2006 13:37:44 -0700
Local: Tues, Aug 15 2006 4:37 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
Google guys don't you the gwt-hosted.html file to load the module
anymore. Because of the cache problem i think. So no parametters send
back to server in hosted mode.
I did upgrade my apps this morning, it was a little pain, but i am ok
now:)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gunnar Wagenknecht  
View profile
 More options Aug 15 2006, 4:40 pm
From: "Gunnar Wagenknecht" <eclipseg...@gmail.com>
Date: Tue, 15 Aug 2006 13:40:39 -0700
Local: Tues, Aug 15 2006 4:40 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
I know that they don't use it anymore. That's what I wrote in my first
post (see top). :)

So, what arguments to you use for launching your development shell?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hovan  
View profile
 More options Aug 15 2006, 4:47 pm
From: "hovan" <huongho...@gmail.com>
Date: Tue, 15 Aug 2006 13:47:33 -0700
Local: Tues, Aug 15 2006 4:47 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
I use ant to launch the hosted mode, just forget about class path.

<target name="run-test.hosted">
                <java classname="com.google.gwt.dev.GWTShell" fork="true">
                        <classpath refid="gwt.classpath"/>
                        <classpath location="${gwtx.jar}"/>
                        <classpath location="${src.dir}/gwtx-test"/>
                        <classpath location="${build.dir}/gwtx-test/classes"/>

                        <arg value="-noserver"/>
                        <arg value="-out"/>
                        <arg value="${build.dir}/gwtx-test/www"/>
                        <arg
value="http://localhost:8080/gwtx-test/com.xp.test.gwtx.XModule/XModule.html"/>
                </java>
        </target>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gunnar Wagenknecht  
View profile
 More options Aug 15 2006, 5:18 pm
From: "Gunnar Wagenknecht" <eclipseg...@gmail.com>
Date: Tue, 15 Aug 2006 14:18:26 -0700
Local: Tues, Aug 15 2006 5:18 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
Mhm. That's weird. I did some debugging and something is different
here. I added two alerts to the the #onLoad in the .nocache.html file.

      $moduleName = mcb.getName();
      $moduleBaseURL = mcb.getBaseURL();
      alert('look:' + $moduleName);
      alert('look:' + $moduleBaseURL);

The module name is correct. But $moduleBaseURL is empty. I think the
problem is my URL.

http://localhost:8080/com.company.product.component.webapp/client/com...

Maybe GWT is confused by the context URL of my webapp. ;)

Cu, Gunnar


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hovan  
View profile
 More options Aug 28 2006, 3:38 pm
From: "hovan" <huongho...@gmail.com>
Date: Mon, 28 Aug 2006 12:38:29 -0700
Local: Mon, Aug 28 2006 3:38 pm
Subject: Re: GWT.getModuleBaseURL() in 1.1 with -noserver option
Gunnar,

This blank thing got fixed on 1.1.10. Now you will get
http://localhost:8888/modulename for hosted mode with or without server
option

hovan.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google