Example of typical Java web service with the most popular technologies: Spring, JPA/Hibernate.
Simplified production environment contains the following components:
- Actor does some action with web/mobile client
- The client sends HTTP request to a server
- Proxy routes request to a particular component
- Static data server holds and serves static data like images, javascript, html and so on
- Java Web service contains business logic and process business data
- Database provide durable storage for business data
Typical Java web service has the following architecture
To build the service the following tools are required:
- JDK 11+
- Maven 3.6+
Execute mvn install
To run the service a servlet container is required. The service works at leat in (Tomcat 9, Jetty 9.24, WildFly 25)
mv target/web-service-example-1.0-SNAPSHOT.war {servletcontierhome}/webapps
- startup your servlet container
To check press http://localhost:8080
or execute curl http://localhost:8080