Pojo层
@component
Dao层
注意使用创建interface文件而不是class*
dao.xml
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="dao.UserDao">
//SQL语句
</mapper>
Service层
与dao层一样也是创建接口文件interface
ServiceImpl层
@Service
@Autowired
Controller层
@Controller
@Autowired
@RequestMapping
springmvc-config.xml
扫描路径