Your first Spring application
Let's start with a very simple Spring application now. This application simply greets the user with a welcome message. Technically, it demonstrates how you configure a Spring ApplicationContext
(IoC container) with just a single bean in it and invoke that bean method in your application. The application has four artifacts in it (besides the project build file, of course):
GreetingService.java
: A Java interface—just a single methodGreetingServiceImpl.java
: A simple implementation ofGreetingService
Application.java
: Your application with amain
methodapplication-context.xml
: The Spring configuration file of your application
The following are the service components of your application. The service implementation just prints ...
Get Spring MVC: Designing Real-World Web Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.