# sy_spring
**Repository Path**: siyit/sy_spring
## Basic Information
- **Project Name**: sy_spring
- **Description**: Spring 核心原理
- **Primary Language**: Java
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-03-30
- **Last Updated**: 2022-06-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 手写 Spring 核心原理
## 传统 SSM
回顾一下传统的 SSM 项目,方便我们更好的理解。
简单搭建一个 SSM 项目:
目录结构:

**搭建步骤:**
1. 创建一个 maven web项目。
略
2. 添加 pom.xml 依赖
```xml
UTF-8
1.8
1.8
5.0.2.RELEASE
1.6.6
org.springframework
spring-webmvc
${spring.version}
```
3. 创建 ApplicalitionContext.xml 配置文件
```xml
```
4. 配置 web.xml
```xml
Archetype Created Web Application
dispatcherService
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:ApplicationContext.xml
1
dispatcherService
/
```
5. 业务编码
```java
@Controller
@ResponseBody
@RequestMapping("ssm")
public class SsmController {
@Autowired
private SsmService ssmService;
@RequestMapping(value = "test",method = RequestMethod.GET)
public Object ssmTest(){
System.out.println("ssm-test");
return ssmService.getList();
}
}
public interface SsmService {
Object getList();
}
@Service
public class SsmServiceImpl implements SsmService {
@Override
public Object getList() {
return "Query database";
}
}
```
**测试**
