First steps in Spring Framework
It's easy! in 5 steps you can start hello world with Spring
1. Set up your Maven project
2. Add Spring Dependency
3. Create a Spring Bean configuration file
4. Create Spring Bean
5. Run the Maven project
Create a Hello class in the / src / main / java directory to test your project.
public class Hello {
@SuppressWarnings("resource")
public static void main(String[] args) {
// loading the definitions from the given XML file
ApplicationContext context = new ClassPathXmlApplicationContext(
"applicationContext.xml");
HelloWorldService service = (HelloWorldService) context
.getBean("helloWorldService");
String message = service.sayHello();
System.out.println(message);
//set a new name
service.setName("Spring");
message = service.sayHello();
System.out.println(message);
}}
Right click Hello.java and run it as Java application. Result:
Hello! Program Creek Readers Hello! Spring
See this tutorial for details
here's other Hello World tutorials with Spring
Spring 3 world greetings example
Spring MVC MVC Welcome Example
If you want to know more, you can see that in this MKYONG guide
In this series of tutorials, he provides many step-by-step examples and explanations of using the Spring framework.
Spring Core Core support for dependency injection, transaction management, web applications, data access, messaging, testing, etc.
Spring MVC , a Java Model-View-Contraller (MVC) web framework that builds on top of the Spring Inversion of Control (IoC) framework.
Spring Security is a flexible and powerful authentication and access control framework for securing a w7612-based Java web application.
Spring Data Mongo DB is part of the Spring Data project, which aims to provide a familiar and consistent Spring - based programming for new data stores while maintaining store-specific features and capabilities.
Spring Package is an open source framework for batch processing - performing a series of tasks. Spring Package provides classes and APIs for reading / writing resources, transaction management, job processing statistics, job reloading, and partitioning methods for processing large amounts of data.
And here , An Introduction to Spring Framework
a source to share