Making GWT application crawlable by a search engine

后端 未结 2 1378
余生分开走
余生分开走 2020-12-28 10:11

I want to use the #! token to make my GWT application crawlable, as described here: http://code.google.com/web/ajaxcrawling/

There is a GWT sample app a

相关标签:
2条回答
  • 2020-12-28 11:01

    Found my answer! The Showcase sample supporting crawlable hyperlinks is in the following branch: http://code.google.com/p/google-web-toolkit/source/browse/branches/crawlability/samples/showcase/?r=7726

    It defines a filter in the web.xml to redirect URLs with the _escaped_fragment_ token to the output of HTML Unit.

    0 讨论(0)
  • 2020-12-28 11:08

    If you want to use web.xml, then I think it won't work with a servlet-mapping, because the url-patterns ignore the get parameters. (Not 100% sure, if there is another way to make this possible.)

    You could of course map Showcase.html to a servlet, and in that servlet decide what to do, based on the get parameter "_escaped_fragment_". But it's a little bit expensive to call a Servlet just to serve a static page for the majority of the requests (not too bad, but still. You could set cache headers, if you're sure that it doesn't change).

    Or you could have an Apache or something in front of your server - but I understand, I wouldn't like to have to do that either. Maybe your JavaEE server (which one are you using BTW?) provides some mechanism for URL filtering before the request gets passed on to the web container - I'd like to know that, too!

    0 讨论(0)
提交回复
热议问题