三、综合案例
3.1 案例需求:完成用户的查询与修改操作
3.2 数据库设计与表结构
3.3 服务器端
3.3.1 配置文件
web.mxl
springmvc.xml
applicationContext.xml
db.properties
jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/vuejsDemo
jdbc.username=root
jdbc.password=root
3.3.2 Controller
@RequestMapping("/user")
@Controller
@ResponseBody
public class UserController {
@Autowired
private IUserService userService;
@RequestMapping(value="/findAll.do")
public List findAll() {
return userService.findAll();
}
@RequestMapping(value="/findById.do")
public User findById(Integer id) {
return userService.findById(id);
}
@RequestMapping(value="/update.do")
public User update(@RequestBody User user) {
return userService.update(user);
}
}
3.3.3 Dao
3.4 客户端
3.4.1 user.html页面
3.4.2 user.js页面
网友评论