/example-spring-annotations

Spring Web MVC (+ Hibernate and Spring Data JPA) hello world without any XML file

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Spring Web MVC (+ Hibernate, Spring Data JPA) hello world without any XML file

No web.xml, no Spring xml configuration file, no persistence.xml, no *.hbm.xml, simply no XML configuration file is in this example, which retrieves data from database and returns them in JSON format.

This project uses embedded HSQL database, which creates an in-memory database at startup and destroys all data at shutdown.

How to run: mvn jetty:run

  • List all customers (in JSON format): http://localhost:8080/customers
  • Customer detail (in JSON format): http://localhost:8080/customers/1

How to build WAR file: mvn package