spring MVC sample web app

2020-01-30 07:04发布

I'm looking for an example Spring MVC 2.5 web app that I can easily:

  • Setup as a project in Eclipse
  • Deploy to a local app server (using Ant/Maven)

There are a couple of example applications included with the Spring distribution ('petclinic' and 'jpetstore'), but they don't provide any Eclipse project files (or a way to generate them). They also seem a bit complicated for my needs, e.g. require a local database to be setup.

9条回答
Melony?
2楼-- · 2020-01-30 07:44

While not specifically an app you can download, Developing a Spring Framework MVC application step-by-step covers creating a spring application in Eclipse with an ant build script, complete with unit tests.

This meets the following requirements:

  • Spring MVC 2.5
  • Project in Eclipse
  • Deploy to a local app server using Ant
  • Uses HSQL (no need to install a local DB)
查看更多
一夜七次
3楼-- · 2020-01-30 07:44

Use AppFuse

查看更多
爷、活的狠高调
4楼-- · 2020-01-30 07:48

The easiest way to get up and running with a Spring MVC project is to use SpringSource Tool Suite, which is another free IDE based on Eclipse.

The integration between the IDE and Spring/Maven is tight, and it comes with an application server already setup for you to deploy your web app.

Follow these steps to get a working Spring MVC web app.

  1. To setup a new project in STS: Click File -> New -> Spring Template Project -> Spring MVC Project
  2. To pull in dependencies and compile your project: Right click your new project -> Run As -> Maven install
  3. To run your project inside an application server: Right click your new project -> Run As -> Run on Server -> SpringSource tc Server

If it works, you'll see a web page saying "Congratulations! You're running Spring!"

查看更多
登录 后发表回答