@RequestMapping(value = "applyLeave", method = RequestMethod.GET)
  public @ResponseBody ModelAndView applyLeave(
      HttpServletRequest request,
      HttpServletResponse response,
      @RequestParam String leaveType,
      @RequestParam String startDate,
      @RequestParam String startDateTime,
      @RequestParam String endDate,
      @RequestParam String endDateTime,
      @RequestParam String reason,
      @RequestParam String handover,
      @RequestParam String notify) {

    String leaveinfo =
        leaveType
            + ","
            + startDate
            + ","
            + startDateTime
            + ","
            + endDate
            + ","
            + endDateTime
            + ","
            + reason
            + ","
            + handover
            + ","
            + notify;
    leavesservice.applyLeave(leaveinfo);
    return new ModelAndView("leaveform", "leaves", leavesservice.getEmployeeLeaves());
  }
 @RequestMapping(value = "cancleLeave", method = RequestMethod.GET)
 public @ResponseBody ModelAndView cancleLeave(
     HttpServletRequest request, HttpServletResponse response) {
   List<Balance> leaveInfo = leavesservice.getLeaveInfo();
   return new ModelAndView("leave/cancel", "leaveinfo", leaveInfo);
 }
 @RequestMapping(value = "leaveForm", method = RequestMethod.GET)
 public @ResponseBody ModelAndView leaveForm(
     HttpServletRequest request, HttpServletResponse response) {
   return new ModelAndView("leave/apply", "leaves", leavesservice.getEmployeeLeaves());
 }