发表于: 2017-09-23 23:05:35
1 831
今天完成的事
学习json
主持周会
完成静态变动态代码部分
完成了controller
主要三个功能 查学员总数,已找到学员数,查职业信息和学员信息 制作学生信息表
@Controller
public class StudentController {
@Autowired
private StudentService studentService;
@Autowired
private ProfessionService professionService;
private static Logger log = Logger.getLogger(StudentController.class);
@RequestMapping(value = "/home", method = RequestMethod.GET)
public String detail(HttpServletRequest request, HttpServletResponse response, Model model) {
try {
//status 2表示已找到工作 1表示在学或其他状态
int graduation = studentService.selectStudentCount(2);
int all= studentService.selectStudentCount(null);
log.info("已找到学员人数:" + graduation);
log.info("学员总数:" + all);
//将统计人数信息绑定在model传如jsp
model.addAttribute("graduation", graduation);
model.addAttribute("all", all);
} catch (Exception e) {
e.printStackTrace();
log.error("错误信息:" + e.getMessage());
return "/common/errorJson";
}
return "/home";
}
//职业介绍页面
@RequestMapping(value = "/profession", method = RequestMethod.GET)
public String profession(HttpServletRequest request, HttpServletResponse response, Model model, @PathVariable int id) {
try{
Profession profession = professionService.selectProfessionById(id);
log.info("查找该职业信息信息");
log.info("职业信息:"+profession);
model.addAttribute("profession"+profession);
}
catch (Exception e ){
e.printStackTrace();
log.error("错误信息"+e.getMessage());
return "/common/errorJson";
}
return "/profession";
}
//所有学员信息制表
@RequestMapping(value = "/student/all",method = RequestMethod.GET)
public String allStudent(HttpServletRequest request,HttpServletResponse response, Model model){
try{
List<Student> studentTable = studentService.allStudent();
log.info("studentTable"+studentTable);
model.addAttribute("studentTable",studentTable);
}
catch (Exception e){
e.printStackTrace();
log.error("错误信息"+e.getMessage());
return "/common/errorJson";
}
return "/table";
}
}
写出要用的sql语句
尝试先把转一点看看 ,但是失败了 ,启动项目有很多报错
改jsp页面的资源路径 因为相对路径变了(这里只贴出一点)下面还有很多
修改页面中要替换成动态的位置
最后注释掉暂时用不上的代码 启动项目 后来发现报错太多 明天在搞
遇到的问题:以上
明天的计划:
学习C标签
解决报错,完成静态变动态
收获:收获了一大堆报错 。。。
任务进度:任务4步骤1
任务开始时间:2017-9-20
预计结束时间:2017-9-27
暂无延期风险
禅道:http://task.ptteng.com/zentao/project-task-276.html
评论