SSM【部分笔记】
Spring
IOC/DI
基本实现


注解实现DI
@Component @Repository @Service @Controller
注解自动装配
@Autowired
@Resource = @Autowired + @Qualifier
AOP
@Aspect

事务管理
@Transactional
SpringMVC
基本实现
- @Controller
- @RequestMapping()
- 视图解析器:prefix +视图名称 + suffix


restful风格
@PathVariable

@RequestParam

ModelAndView






@ResponseBody
将不会进行跳转,直接返回数据,可用于AJAX
上传、下载、拦截器
MyBatis
基本实现
一个Interface
一个mapper.xml
一个扫描文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.etc.dao.user.UserMapper">
<select id="countUser" resultType="int">
SELECT COUNT(1) FROM SMBMS_USER
</select>
</mapper>
public interface UserMapper {
int countUser();
}
${}/#{}


获取自增主键的值

@param


高级映射、动态SQL
知识离开了脑子,就只是一堆文字

浙公网安备 33010602011771号