RouterToken + RPC + gwt-pushstate issue?

38 views
Skip to first unread message

Shawn Johnson

unread,
Oct 5, 2015, 7:00:50 PM10/5/15
to GWTP
I recently dropped gwt-pushstate into my gwt-platform project and it appears to be working very well right from the start.  There are a few hitches so far, the biggest one being a nice-to-have using RouteTokenPlace.  I changed my previous place from "!document" to "document/{id}".  This part works fine, however when the first RPC call runs, it tries to call "/document/dispatch/GetDocument".  All other RPC's run as-expected in non-RouterToken places.  Any idea why the token portion is being prepended?

Shawn Johnson

unread,
Oct 7, 2015, 7:03:15 PM10/7/15
to GWTP
I am getting ever so slightly closer to figuring this out.  I made one change that actually fixed the issue, but I don't think it's the "right way" to do it.  I edited my generated Action class GetDocumentAction and prefixed the value returned by getServiceName() with a forward slash.

Ex.
  @Override
 
public String getServiceName() {
   
return "/" + Action.DEFAULT_SERVICE_NAME + "GetDocument";
 
}


I don't think this would work if the application wasn't running in the root context.

I've followed the code all the way down to the XMLHttpRequest class.  It appears that the url passed in will be opened relative to the current context.  In this case the Url is now prefixed with "/document" to represent the first part of my place token name.

There has got to be a better way...something I'm missing or overlooking - please anyone have any ideas?

Richard Wallis

unread,
Oct 7, 2015, 10:32:49 PM10/7/15
to GWTP
--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shawn Johnson

unread,
Oct 9, 2015, 10:12:49 AM10/9/15
to GWTP
Richard,
Thanks for the reply, I was using that setting when I was running my app under a context, however now I'm running the app in the root context - i didn't think I still would need to set this?  The issue only occurs when using RouteToken, the other RPC's for places without a parameter in the nameToken work fine.  I'm not sure what changes the page's sense of it's path?  I'm guessing this is something with the pushState + the nature of the Route Token.
Reply all
Reply to author
Forward
0 new messages