GWT browser plugin not used with Web rewrite rules?

114 views
Skip to first unread message

Ed

unread,
Nov 2, 2015, 6:12:43 PM11/2/15
to GWT Users
I am using html 5 push and as such perform some rewriting in the apache web server to ensure that all urls that not point to an existing file or directory, are changed to  /index.html.

However, if I do this, the Firefox GWt plugin isn't used anymore. Why ? How and when is the GWT browser plugin being triggered/used?

My apache config part:
<Directory "/Users/ed/Develop/Web/plus" >
  RewriteRule ^plus/$ - [NC,L]
  RewriteRule ^plus/index.html$ - [NC,L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule plus/(.*) plus/index.html [NC,L]
</Directory>

The url that work fine, because the last rewrite isn't used (seen in the apache log with rewrite trace enabled):
 http://localhost/plus/bla1/index.html?gwt.codesvr=127.0.0.1:9997

The url that doesn't work, because the last rewrite is used:
http://localhost/plus/bla1/index.html?gwt.codesvr=127.0.0.1:9997

The index.html is started, and will show the "loading..." text, that is normally removed when the GWT app is started and will remove it. However, the gwt app is never started.
No idea why, the query param part is copied by default (accoding to the apache 2.4 doc).
Please some help? (why/how is the gwt plugin triggered to start working).
- Ed

post2...@gmail.com

unread,
Nov 3, 2015, 10:39:57 AM11/3/15
to google-we...@googlegroups.com
I just noticed i made a mistake in the first url above that works fine, it should be: http://localhost/plus/index.html?gwt.codesvr=127.0.0.1:9997
This works fine but when adding the 'bla1' url (the second url) the GWT plugin is 't used :(

How/when is the gwt browser plugin used?
Ed
--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/tveyo0-UTCw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Thomas Broyer

unread,
Nov 3, 2015, 12:46:42 PM11/3/15
to GWT Users
Is the *.nocache.js found?
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.

Ed Bras

unread,
Nov 3, 2015, 3:57:10 PM11/3/15
to google-we...@googlegroups.com
@Thomas: yes, it's found, see the attached screenshot:
1) The one with the url: /plus/index.html?gwt.codesvr=127.0.0.1:9997:  it ends by loading a cms xml file that is done in the GWT app.

2) The one with the url: /plus/bla1/index.html?gwt.codesvr=127.0.0.1:9997:  it ends with loading the kissmetrics script. After that nothings happens as the app doesn't start.

Please some advice on where to look so I can solve it?  



Inline images 1

Inline images 2

Ed Bras

unread,
Nov 3, 2015, 4:06:27 PM11/3/15
to google-we...@googlegroups.com
BTW: I was just testing some more and for some reason the last rewrite rule "RewriteRule plus/(.*) plus/index.html [NC,L]" is changing something (even do it shouldn't). I should copy the query params.
If I change this rule to "RewriteRule plus/(.*) - [NC,L]" such that nothing is changed and create a sub dir "bla1" with all required content, it does work...
So what is the first rewrite rule changing such that the gwt plugin not work ?... :(
 

Ed Bras

unread,
Nov 3, 2015, 4:11:43 PM11/3/15
to google-we...@googlegroups.com
What I forgot: I think that the GWT plugin is exactly reading the browser URL and use it. A such it will look in the /plus/bla1 location.
If I use the rewrite rule "RewriteRule plus/(.*) plus/index.html [NC,L]" with the sub dir "bal1" that contains the same files as the root, it works.

I think I always have to create this sub dir with the root content, not ? Else, how will the GWT plugin knows in which URL location to look not ?
But why does the GWT plugin exactly look in that location? What does it do?

- Ed  

Thomas Broyer

unread,
Nov 3, 2015, 4:19:56 PM11/3/15
to GWT Users
But is the plus.nocache.js your script or your index.html (because of a relative path resolving to an inexistent file, that gets rewritten to index.html)

Ed Bras

unread,
Nov 3, 2015, 4:39:39 PM11/3/15
to google-we...@googlegroups.com
@Thomas: the plus.nocache.js is my script that is included in the index.html:
  <script type="text/javascript" src="plus.nocache.js"></script>

Let me see if I understand you correctly:
You think that it will look for /plus/bla1/plus.nocache.js which doesn't exists such that the server returns index.html ?
Hmmmm, just checked and I am afraid you are right :(, see screenshot...
I have to think about this....come up with a better solution: use absolute paths or use relative and handle it correctly on the server....

Some side info: 
+ I am running GWT in no-server mode. 
+ I don't use the eclipse plugin, but use Eclipse launch files to run Dev mode.


Inline images 1

Ed Bras

unread,
Nov 3, 2015, 5:18:32 PM11/3/15
to google-we...@googlegroups.com
One solution that seem to work: 
Use of the old fashion base tag in the index.html:
   <base href="/plusRoot/plus"> 
I am just not so font of making the index.html location/url dependent, such that you have to edit the index.html during deployment...... but you have to tell the browser which base url to use when performing some kind of url dispatching that results in changed url paths...

I noticed it's a well known issue with using html 5 pushstate, see: LINK

Would be nice to be able to solve it in apache, such that it's set per app (location)... I will have a look...
Any ideas ? 


Ed

unread,
Nov 4, 2015, 11:50:37 AM11/4/15
to GWT Users
I am going for the <base> tag in the index.html, as solving it in the web server config is almost impossible.
Reply all
Reply to author
Forward
0 new messages