GWT: Loading different UI's based on URL
Trying to get a GWT project off the ground and finding it difficult to do any basic routing.
Trying to fire up different UI's based on the URL. Thought I could set a string based on the getHash() and then switch off that, but seems cumbersome (and annoying since I can't do string-based switches in Java).
There's got to be a best practice for this. I know Gerrit uses hashes for determining this type of information but couldn't find where they do i开发者_运维技巧t in the source.
Or is this totally not GWT-related? Something I can handle in web.xml?
Any help is much appreciated.
If you want to load different UIs by using different URLs, instead of doing it directly from client side (gwt code), one way I can think of is to separate your application in several modules and have different host pages (dynamically generated from server side) load each module.
Not sure it's the best way, but I guess it depends on what type of application you're building.
So far, in GWT I only built desktop like applications so... once I loaded the GWT app I didn't cared about URL's and stuff.
Url's can be loaded using a "Place" manager. Support for this is handled through GWT presenter: http://code.google.com/p/gwt-presenter/
import net.customware.gwt.presenter.client.place.PlaceManager
精彩评论