【总结】项目结构说明
2019-11-16 本文已影响0人
giraffecode9668
首先是项目结构
主目录开发在src下,存在一个main文件夹,其中含有java包、resource包、和webapp包
![](https://img.haomeiwen.com/i15569173/77f5c6bfb9027955.png)
标记java为源代码包,resource包围resource包(资源包)
![](https://img.haomeiwen.com/i15569173/b34dd40adff8d5a3.png)
控制器
控制器ForeController中,使用springmvc框架中注解的实现映射对应的响应。
@Controller
@RequestMapping("")
public class ForeController {
}
首页_forehome
@RequestMapping("forehome")
public String home(Model model) {
List<Category> cs= categoryService.list();
productService.fill(cs);
productService.fillByRow(cs);
model.addAttribute("cs", cs);
return "fore/home";
}
mybatis使用的是xml实现方法
![](https://img.haomeiwen.com/i15569173/328214d4ca32ae1f.png)