Содержание
При создании проекта использовался NetBeans 7-й версии. Вместо NetBeans Вы можете использовать любую удобную среду разработки. Например, Eclipse или IntelliJ IDEA.
Создаем проект в NetBeans, выполнив комманду "New Project" меню "File":
File -> New Project
В списке Categories выбираем Maven, в списке Projects - Web Application (см. Рис.1)
Рис 1. Создание проекта. Новый проект
Кликаем "Next >" и заполняем следующие поля:
Рис 2. Создание проекта. Имя и расположение
Кликаем "Next >" и выбираем используемый сервер или добавляем новый если список серверов пуст.
Рис 3. Создание проекта. Настройки
При создании приложения использовался Maven. Если Вы не используете Maven, подключите следующие библиотеки к проекту:
aopalliance-1.0.jar
commons-lang-2.6.jar
commons-logging-1.1.1.jar
log4j-1.2.16.jar
spring-aop-3.0.5.RELEASE.jar
spring-asm-3.0.5.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-binding-2.3.0.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-context-support-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-expression-3.0.5.RELEASE.jar
spring-js-2.3.0.RELEASE.jar
spring-js-resources-2.3.0.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
spring-webflow-2.3.0.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
Для облегчения размещения файлов по проекту приводим структуру проекта:
Рис 4. Структура проекта
В pom.xml добавляем следующие строки:
<properties>
...
<webflow.version>2.3.0.RELEASE</webflow.version>
</properties>
и
<dependencies>
...
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-binding</artifactId>
<version>${webflow.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-js</artifactId>
<version>${webflow.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-js-resources</artifactId>
<version>${webflow.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>${webflow.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
В третьей части статьи будет описан процесс настройки Spring Web Flow.
< | Spring Web Flow. Hello World! Часть 1. Введение | Spring Web Flow. Hello World! Часть 3. Настройка SWF | > |