... | @@ -2,9 +2,48 @@ |
... | @@ -2,9 +2,48 @@ |
|
|
|
|
|
1. Создайте в IDEA EAP или студенческой версии проект Maven без использования архетипов
|
|
1. Создайте в IDEA EAP или студенческой версии проект Maven без использования архетипов
|
|
2. Скачать архив tomcat: https://tomcat.apache.org/download-90.cgi
|
|
2. Скачать архив tomcat: https://tomcat.apache.org/download-90.cgi
|
|
3. Создайте в папке src/main подпапку webapp, а в ней WEB-INF. Положить в WEB-INF заготовки файлов web.xml и spring-app.xml.
|
|
3. Создайте в папке src/main подпапку webapp, а в ней WEB-INF.
|
|
4. Создать в src/main/webapp index.jsp.
|
|
4. Создать в src/main/webapp index.jsp.
|
|

|
|

|
|

|
|

|
|
|
|
|
|
5. Добавить в pom.xml строку ``<packaging>war</packaging>`` и библиотеки spring-webmvc. |
|
5. Добавить в pom.xml строку ``<packaging>war</packaging>``
|
|
\ No newline at end of file |
|
|
|
|
|
|
|
|
|
6. Положить в WEB-INF заготовки файлов web.xml и spring-app.xml.
|
|
|
|
см. также
|
|
|
|
https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html
|
|
|
|
|
|
|
|
[web.xml](uploads/6bf838bc9c8ff0aa684a7e33dbc603ca/web.xml)
|
|
|
|
|
|
|
|
|
|
|
|
7. Добавить библиотеки spring-webmvc, jsp и сервлетов в pom.xml:
|
|
|
|
```xml
|
|
|
|
<properties>
|
|
|
|
<maven.compiler.source>1.8</maven.compiler.source>
|
|
|
|
<maven.compiler.target>1.8</maven.compiler.target>
|
|
|
|
</properties>
|
|
|
|
<dependencies>
|
|
|
|
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.springframework</groupId>
|
|
|
|
<artifactId>spring-webmvc</artifactId>
|
|
|
|
<version>5.1.5.RELEASE</version>
|
|
|
|
</dependency>
|
|
|
|
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api -->
|
|
|
|
<dependency>
|
|
|
|
<groupId>javax.servlet.jsp</groupId>
|
|
|
|
<artifactId>javax.servlet.jsp-api</artifactId>
|
|
|
|
<version>2.3.3</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
|
|
|
|
<dependency>
|
|
|
|
<groupId>javax.servlet</groupId>
|
|
|
|
<artifactId>javax.servlet-api</artifactId>
|
|
|
|
<version>4.0.1</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
```
|
|
|
|
|