Зміст
При створенні проекту використовувався 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 | > |