I have a GWT MVP application with one page. How can I create a new page and link to it?
I created a open source, MIT licensed project to ease the page navigation handling in GWT. Take a look at the GWT Views project.
Using it you can define a View (a Widget referenced by an unique URL token) using simple Java annotations. The framework takes care of code-splitting for you, and hides all the boilerplate code.
Here is an example:
@View(Login.TOKEN)
public class Login extends Composite {
//... your code, you can use UIBinder, procedural UI, whatever you like
When using History.newItem(Login.TOKEN)
the Login
widget will be rendered at the page.
There are a lot of common use cases handled by the framework as well, such as ViewContainers, 404 pages, Google Analytics tracking, and user authorization.