There is a simple (tricky) way to achieve this:
Make a Main class Your entry point.
<module rename-to='gwt'>
<inherits name='com.google.gwt.user.User'/>
<entry-point class='com.example.client.Main'/>
<source path='client'/>
<source path='shared'/>
</module>;<br/>
Create this Main.java to work like a dispatcher:
package com.example.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
public class Main implements EntryPoint {
public void onModuleLoad() {
String url = Window.Location.getHref();
if ( url.indexOf("?install")>-1 ) {
Install install = Install.getInstance();
RootPanel.get().add(install);
else if ( url.indexOf("?admin")>-1 ) {
Admin admin = Admin.getInstance();
RootPanel.get().add(admin);
} else {
Application app = Application.getInstance();
RootPanel.get().add(app);
}
}
}
Now the different classes Application, Admin and Install
work like seperate units.
Here is for example a simple Install:
package comexample.client;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
public class Install extends FlowPanel {
/** Singleton stuff - to access Main from all subclasses! */
private static Install singelton;
public static Install getInstance() {
if (singelton == null) {singelton = new Install();}
return singelton;
}
/** Constructor - called by Main.onModuleLoad() */
private Install() {
this.add(new HTML("<h1>Do whatever You have to do!</h1>"));
}
}
You don't need the Singleton stuff (getInstance), but it is very handy in big applications.
Now in the /war-directory create directories named install and admin and in very of them create an HTML page like this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; URL=/index.html?install">
</head>
<body></body>
</html>
So when the user directs his Brower to http://www.example.com/install he will be redirected to http://www.example.com/index?install and index.html is bound to Main.java which will dispatch the request and load Install.java