I ran into this issue recently, its particularly annoying if you want to have your site work javascript free (for search engine bots), as well as allowing the user to just save links as they would normaly. (or cutting and pasteing the url etc).
Frankly, there is no good solution. Best I found you can do is have a button on your site that generates a url which users can use to exchange with eachother. (like google maps does). Just taking the url with the # would work fine for users with javascript, but not without. What helps a little bit though, is you can use a little big of javascript to automaticaly turn a "?" into a "#". So you can effectively have two versions of the site with nearly the same urls/ parameters, and those with javascript will see the history token method, and those without see the normal query. The two mighty Ians helped me out on this thread here; http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/84ff65a3b75fca26 ------- On Sep 28, 9:07 pm, Célio <[email protected]> wrote: > Alternatively, you can do something like what gmail does, for example: > > http://mail.google.com/a/foo.net/#search/bananas/12231c45beef16c4 > > No matter what choice you make, in the end you will always have to > parse your tokens. > > On 27 set, 14:10, Sripathi Krishnan <[email protected]> > wrote: > > > > > You can still have 'query parameters' in the history token. > > >http://mywebsite.com?param1=value1¶m2=value2#?param3=value3¶m... > > > - The above url is an example. param1 and param2 are the only ones that > > will be available to you on server side via request.getParameter. > > - GWT provides you a convenient way to read param1 and param1, but as > > Thomas mentioned - you can't modify them in javascript without reloading > > the > > page. > > - Anything after the # will not be accessible on the server side, but is > > accessible on the client side. > > - GWT will give you the entire string "?param3=value3¶m4=value4" to > > your HistoryListener - and thereafter it is a simple matter ofparsing out > > the string manually. > > > So, you can still achieve what you want by using a token that has ? and &, > > and doing the parsing yourself. It is a bit convoluted, but is perhaps the > > only way right now. > > > --Sri > > > 2009/9/27 Thomas Broyer <[email protected]> > > > > On 27 sep, 02:36, Jaap <[email protected]> wrote: > > > > The way I understand it you can history in your gwt app by using a > > > > history token which is displayed as follows in the URL > > > > >http://www.example.com/#token > > > > > I actually need a combination of tokens and prefer to use the normal > > > > syntax you have with GET urls. So I'd like to have history which looks > > > > like > > > > >http://www.example.com/?locale=es&query=test > > > > > Is this possible with GWT > > > > No, because it's just not possible at all with anything JavaScript. > > > > FYI, HTML5 defines a pushState() that'll allow such a thing, but to my > > > knowledge no-one has implemented it already (but work is underway in > > > at least Firefox and WebKit) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
