Spring:MVC: Unterschied zwischen den Versionen

Aus Alexander's Wiki
K
Zeile 6: Zeile 6:


== Erstellung ==
== Erstellung ==
Wir benutzen den ''archetype'' '''spring-mvc-archetype'''.
In Eclipse:
* File / new / Maven Project
* Create a simple project (skip archetype selection) darf '''NICHT''' gesetzt sein
* Next
* Add Archetype
** Archetype Group Id: co.ntier
** Archetype Artifact Id: spring-mvc-archetype
** Archetype Version: 1.0.2
** Repository URL: http://maven-repository.com/artifact/co.ntier/spring-mvc-archetype/1.0.2
== Erstellung (Outdated) ==
* Eclipse mit neuem Workspace öffnen, z.B. analog folgende Verknüpfung:
* Eclipse mit neuem Workspace öffnen, z.B. analog folgende Verknüpfung:
<syntaxhighlight line lang="bash">
<syntaxhighlight line lang="bash">

Version vom 11. November 2016, 22:14 Uhr

Umgebung

  • Java JDK 1.8
  • Tomcat
  • Eclipse JEE Version
  • Maven (Spring kommt als Maven dependency)

Erstellung

Wir benutzen den archetype spring-mvc-archetype. In Eclipse:


Erstellung (Outdated)

  • Eclipse mit neuem Workspace öffnen, z.B. analog folgende Verknüpfung:
E:\Entwicklungsumgebungen\eclipse-jee-neon-x64\eclipse.exe -data "E:\Entwicklungsumgebungen\data_and_configuration\data\PRIVAT\SpringMVC-simple" -configuration "E:\Entwicklungsumgebungen\data_and_configuration\configuration\PRIVAT\SpringMVC-simple"
  • File/New/Dynamic Web Project
    • Project Name setzen, z.B. SpringMVCTutorial
    • Target Runtime -> Apache Tomcat 8.5
  • Konvertieren des Projekts in
    • m2e-eclipse muss als PlugIn in Eclipse installiert sein
    • Rechte Maustaste auf das Projekt -> Configure -> "Convert to Maven Project"
  • Das POM modifizieren (über die Oberfläche) und Dependencies hinzufügen
    • <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.3.3.RELEASE</version>
    • <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>4.3.3.RELEASE</version>
    • <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.3.3.RELEASE</version>
    • <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.3.3.RELEASE</version>
    • <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version>