Hello World Spring MVC

1, Setup Development Environment
1.1, Install Java SDK

| => java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

1.2, set up $JAVA_HOME env variable on Mac

| => echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home

Set $JAVA_HOME environment variable on Mac OS X(Mac OSX 10.5 or later)

$ vim .bash_profile 
export JAVA_HOME=$(/usr/libexec/java_home)
$ source .bash_profile

1.3, Install Spring Tool Suite develop tool
Download Spring Tool Suite, and install it.

2, Create a Spring MVC project by Spring Starter Project

Click "Import Spring Getting Started Content"


Hello World Spring MVC_第1张图片
Spring Starter Project

Select "Serving Web Content" template

Hello World Spring MVC_第2张图片
Serving Web Content

Select Install JRE to fix project error

Hello World Spring MVC_第3张图片
Select Installed JRE

Launch web site


Hello World Spring MVC_第4张图片
run as spring boot app

Hello World Spring MVC_第5张图片
launch.png

Resource: Serving Web Content with Spring MVC

你可能感兴趣的:(Hello World Spring MVC)