Reputation: 3046
I am using Activities and Places.
I have a LoginPlace.
The url displayed when I navigate to that place has this at the end:
#LoginPlace:login
How can I change this to just #login or something else?
My tokenizer looks like this:
public class LoginTokenizer implements PlaceTokenizer<LoginPlace> {
private LoginPlace loginPlace;
public LoginTokenizer() {
}
@Override
public LoginPlace getPlace(String token) {
return new LoginPlace(token);
}
@Override
public String getToken(LoginPlace place) {
loginPlace = place;
return loginPlace.getLoginToken();
}
}
And navigation to the LoginPlace is done through the PlaceController:
clientFactory.getPlaceController().goTo(new LoginPlace("login"));
Where can I manipulate the format of the URL?
Upvotes: 0
Views: 273
Reputation: 64541
The mapping is done by the PlaceHistoryMapper
.
You can have an implementation generated by GWT based in PlaceTokenizer
s, but then it's based on a prefix/suffix. The @Prefix
allows you configure the prefix (which otherwise defaults to the place class' name).
Or you can implement the interface yourself and have complete control over the process.
Upvotes: 1
Reputation: 41089
Rename the Place class from LoginPlace
to Login
.
Pass an empty token:
new LoginPlace("")
Upvotes: 0