Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The idea of Ajax is that an application doesn't load new pages all the time, but loads new pieces of content using Ajax requests in the background. To provide “deep links” into your application anyway, you need URLs that contain a fragment part, such as <code>example.com/myapp#mystate</code>. This trick is used because a browser does not reload the page when only the fragment part of the URL changes.</p> <p>This is no different with RAP. To deal with this kind of URLs, RWT provides a browser history API. When the state of your application changes, e.g. when the user selects some kind of tab or fires up a search, you can add a new entry to the browser history, which effectively changes the fragment of the URL in the browser:</p> <pre><code>RWT.getBrowserHistory().createEntry( "!mystate", "Example" ); </code></pre> <p>This will change the URL to <code>example.com/app/entrypoint#!mystate</code> (the “deep link” to this state) and adds an entry named "Example" to the browser history, so you can use the browser's back button to get back to this state later.</p> <p>To be able to react on changes of the URL, you have to add a listener to the browser history. This listener will be notified every time the fragment part changes. This is also the case when application is started with a fragment (someone follows a deep link). Your application is then responsible to re-install the state that is represented by this fragment.</p> <pre><code>RWT.getBrowserHistory().addBrowserHistoryListener( new BrowserHistoryListener() { public void navigated( BrowserHistoryEvent event ) { // show state represented by event.entryId } } ); </code></pre> <p>An example for a RAP application that uses fragment URLs for different “sub-pages” is the <a href="http://rap.eclipsesource.com" rel="noreferrer">RAP examples demo</a>.</p> <p>The rest of the story should be explained in <a href="http://support.google.com/webmasters/bin/answer.py?hl=en&amp;answer=174992" rel="noreferrer">Google's AJAX crawling guide</a>. Your ids have to start with a <code>!</code> to produce URLs with a fragment like <code>#!mystate</code>. These URLs are the ones that you should add to your sitemap. To feed the crawlers, you could implement a servlet filter that catches requests to the URL pattern <code>?_escaped_fragment_=mystate</code> and returns an HTML representation of the particular state.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload