Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
book-of-vaadin.pdf
Скачиваний:
88
Добавлен:
24.03.2015
Размер:
13.43 Mб
Скачать

Using Vaadin Add-ons

Then, just deploy the WAR to your application server.

Recompiling the Widget Set

The Vaadin plugin for Maven tries to avoid recompiling the widget set unless necessary, which sometimes means that it is not compiled even when it should. Running the clean goal usually helps, but causes a full recompilation. You can compile the widget set manually by running the vaadin:compile goal.

$ mvn vaadin:compile

Note that this does not update the project widget set by searching new widget sets from the class path. It must be updated if you add or remove add-ons, for example. You can do that by running the vaadin:update-widgetset goal in the project directory.

$ mvn vaadin:update-widgetset

...

[INFO] auto discovered modules [your.company.gwt.ProjectNameWidgetSet] [INFO] Updating widgetset your.company.gwt.ProjectNameWidgetSet

[ERROR] 27.10.2011 19:22:34 com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets

[ERROR] INFO: Widgetsets found from classpath:

...

Do not mind the "ERROR" labels, they are just an issue with the Vaadin Plugin for Maven.

After running the update, you need to run the vaadin:compile goal to actually compile the widget set.

17.4.3. Enabling Widget Set Compilation

If you are not using a POM created with the proper Vaadin archetype, you may need to enable widget set compilation manually. The simplest way to do that is to copy the definitions from a POM created with the archetype. Specifically, you need to copy the plugin definitions.You also need the Vaadin dependencies.

You need to create an empty widget set definition file, which the widget set compilation will populate with widget sets found from the class path. Create a src/main/java/com/example/AppWidgetSet.gwt.xml file (in the project package) with an empty <module> element as follows:

<module>

</module>

Enabling the Widget Set in the UI

If you have previously used the default widget set in the project, you need to enable the project widget set in the web.xml deployment descriptor. Edit the src/main/webapp/WEB-INF/web.xml file and add or modify the widgetset parameter for the servlet as follows.

<servlet>

...

<init-param>

<description>Widget Set to Use</description> <param-name>widgetset</param-name> <param-value>com.example.AppWidgetSet</param-value>

</init-param> </servlet>

390

Enabling Widget Set Compilation

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]