- Spring MVC Beginner’s Guide
- Amuthan G
- 325字
- 2021-07-16 11:25:40
Time for action – creating a Spring MVC project in STS
Let's create our first spring MVC project in STS:
- In STS, navigate to File | New | Project; a New Project wizard window will appear.
- Select Maven Project from the list and click on the Next button, as shown in the following screenshot:
Maven project's template selection
- Now, a New Maven Project dialog window will appear; just select the checkbox that has the Create a simple project (skip archetype selection) caption, and click on the Next button.
- The wizard will ask you to specify artifact-related information for your project; just enter Group Id as
com.packt
, Artifact Id aswebstore
. Then, select Packaging aswar
and click on the Finish button, as shown in the following screenshot:
What just happened?
We just created the basic project structure. Any Java project follows a certain directory structure to organize its source code and static resources. Instead of manually creating the whole directory hierarchy by ourselves, we just handed over that job to STS. By collecting some basic information about our project, such as Group Id, Artifact Id, and the Packaging style from us, it is clear that STS is smart enough to create the whole project directory structure with the help of the Maven plugin. Actually, what is happening behind the screen is that STS is internally using Maven to create the project structure.
We want our project to be deployable in any servlet container-based web server, such as Tomcat, and that's why we selected the Packaging style as war
. After executing step 4, you will see the project structure in Package Explorer, as shown in the following screenshot:

The project structure of the application
Spring MVC dependencies
As we are going to use Spring MVC APIs heavily in our project, we need the Spring jars in our project during the development. As I already mentioned, Maven will take care of managing dependencies and packaging the project.
- 我們都是數(shù)據(jù)控:用大數(shù)據(jù)改變商業(yè)、生活和思維方式
- PyTorch深度學(xué)習(xí)實戰(zhàn):從新手小白到數(shù)據(jù)科學(xué)家
- 大數(shù)據(jù)導(dǎo)論
- WS-BPEL 2.0 Beginner's Guide
- 數(shù)據(jù)驅(qū)動設(shè)計:A/B測試提升用戶體驗
- 數(shù)亦有道:Python數(shù)據(jù)科學(xué)指南
- Hadoop大數(shù)據(jù)開發(fā)案例教程與項目實戰(zhàn)(在線實驗+在線自測)
- 菜鳥學(xué)SPSS數(shù)據(jù)分析
- 大數(shù)據(jù)技術(shù)原理與應(yīng)用:概念、存儲、處理、分析與應(yīng)用
- Oracle 11g+ASP.NET數(shù)據(jù)庫系統(tǒng)開發(fā)案例教程
- Hands-On System Programming with C++
- 數(shù)據(jù)庫技術(shù)與應(yīng)用:SQL Server 2008
- SQL Server 2012數(shù)據(jù)庫技術(shù)及應(yīng)用(第4版)
- Applying Math with Python
- 工業(yè)大數(shù)據(jù)工程:系統(tǒng)、方法與實踐