multiple applications/urls

Hi,

I just got started with my first “hello world” Vaadin app. Having a setup which includes maven, spring security, JPA and now JRebel I just can’t wait to get serious. However, I’m wondering how I will achieve some very basic requirement with my project which are:

  1. I need to have two different apps: one for regular users, the other for admins
  2. In the admin app, I need to enable access to an editable user properties page for a specific user with a parameter-passing URL which would include the user’s ID and perhaps some other information.

Other said:

  1. I guess I cannot have two different Vaadin applications in the same webapp, or can I?
  2. Is it possible to map urls to a Vaadin app that would extract the URL’s parameters to pass on to a service or a customizing init() method for instance?

Cheers,

Candide

You can have more than one Vaadin app in one war: vaadin app is just a servlet, you can always register two or more servlets (I didn’t tried this but should work)

In your case you can have just two application level windows (in one app):

YourApplicationClass#init(){
Window mainWindow = new MainWindow();
setMainWindow(mainWindow);

Window adminWindow = new AdminWindow();
adminWindow.setName(“admin”)
addWindow(adminWindow);
}

Windows will be availible with urls:
domian.com/ - main window
domain.com/admin - admin window

If I understand correctly, for parameters handling you need something like this:
domain.com/admin#user/10 - access to user info with id 10

You can achieve that with Navigator7 or AppFoundation addons (look in the directory)
(or using pure UriFragmentUtility bundled with Vaadin)

OK Fantastic! Thanks a lot.