> I do the following: It's not a very elegant solution and you still have only one entry point. You mainly dispatch depending on the action found in the url.
I would definitely get ride of the refresh action which causes an extra server-client round trip. Round trips should be minimized as much as possible as they are costly. In your case they aren't needed. Examples: You use Tomcat, so use a dynamic hosting page that uses a servlet that set some properties in the html page that will be used by the dispatcher. Works very fast. See: http://code.google.com/webtoolkit/articles/dynamic_host_page.html Or if you use a front-end web server (in front of your tomcat) let the web server do the redirection. etc.... pick one.. - Ed On Tue, Dec 20, 2011 at 9:53 AM, Maximilian Eberl <[email protected]> wrote: > I do the following: > > Create an application in a war named ROOT.war - when deployed to > Tomcat this reacts to > www.myserver.com/index.html > > Let us assume You want three "entry points" > / - (the main application - public) > /membersonly - login secured area > /admin - the admin area > > So create two folders in /war > /war/admin > /war/members > > In these folders create an HTML page like > !DOCTYPE html > html > head > meta http-equiv="refresh" content="0; URL=/index.html?admin" > /head > body /body > /html > > So any call to www.myserver.com/admin > will be redirected to > www.myserver.com/index.html?admin > > Now create a Main.java as real entry point: > > public void onModuleLoad() { > String url = Window.Location.getHref(); > > if ( url.indexOf("?admin")>-1 ) { > Admin admin = new Admin(); > RootPanel.get().add(admin); > } else if ( url.indexOf("?member")>-1 ) { > Member member = new Member(); > RootPanel.get().add(member); > } else { > Application app = new Application(); > RootPanel.get().add(app); > } > } > > Any of these (Admin.java, Member.java, Application.java) is the base > of its own GWT client app. They share all services, libs and shared > classes and resources. > > Works perfect for me. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
