I have a webapp example.com written in pure GWT. Obviously the webapp
has dynamic links, like example.com/#/link1.
I want example.com/#/link1 to be accesible from outside my website. For example. I would like to post the example.com/#/link1 link in facebook.com so my friends can see it. However, when someone clicks on the link, it will take him to example.com, NOT example.com/#/link1, even though I have a valueChangeHandler in my EntryPoint.
So my question is, how to make dynamic links accesible from outside my GWT page.
EDIT: found out answer:
In EntryPoint do the following
public void onModuleLoad() {
String initState = History.getToken();
//This is your initial token for your gwt ap
System.out.println(initState);
//Do any stuff you want to here, like init some stuff in your app, and finally:
History.newItem(initState);
//That las line calls the initial state of your app. This worked for me because I
//changed the history state in between, so I had to save initialState, do stuff and then
//fire inistial state.
}
It seems to me like you need to work with Activities and Places to handle browser history. This creates a link between a place/state/page in your application and the URL in the browser by inserting/parsing URL place tokens. Have a look at the content of this Google Dev page.
You should be able to do what you want with history handling. You define a set of tokens which describe places/pages/whatever state in your application. Your app parses tokens in the URL and redirects to the appropriate page/view.