web层@Controller
@RequestMapping("/attendance/attendanceCheckIn.do")
public class AttendanceCheckInController
{

private final AttendanceCheckInService attendanceCheckInService;
private final AttendanceCustomParaService attendanceCustomParaService;
private final OverTimeReportService overTimeReportService;
private final AttendancePersonSchedulingService personSchedulingService;
private final AttendanceSpecialWorkSystemService specialWorkSystemService;

@Autowired
public AttendanceCheckInController(AttendanceCheckInService attendanceCheckInService,
AttendanceCustomParaService attendanceCustomParaService
,OverTimeReportService overTimeReportService,
AttendancePersonSchedulingService personSchedulingService,
AttendanceSpecialWorkSystemService specialWorkSystemService)
{
super();
this.attendanceCheckInService = attendanceCheckInService;
this.attendanceCustomParaService = attendanceCustomParaService;
this.overTimeReportService = overTimeReportService;
this.personSchedulingService=personSchedulingService;
this.specialWorkSystemService=specialWorkSystemService;
}



//跳转到签到界面
@RequestMapping(params = "method=checkIn", method = RequestMethod.GET)
public String setupForm(HttpServletRequest request, Model model,HttpSession session,HttpServletResponse response)
throws Exception
{


System.out.println("=====================================");
return "/attendance/attendanceCheckIn";
}
}
页面  attendanceCheckIn.jsp<html><body>hello</body></html> 问题描述:每当执行到return "/attendance/attendanceCheckIn";就是不跳转,又重新执行该方法2次。才最终跳转。控制台打印“=====================================”三次。请问是什么原因
Springbug

解决方案 »

  1.   

    把@RequestMapping("/attendance/attendanceCheckIn.do") 放到跳转方法前面
      

  2.   


    这样不可行。我们的路径是    /attendance/attendanceCheckIn.do?method=checkIn
      

  3.   


    已经验证过跟前台的JSP是没关系的。
      

  4.   

    1.构造方法上怎么会有@Autowired?
    2.把/attendanceCheckIn.do放到方法上
      

  5.   

    已经执行到方法里了  说明就不是配置的问题了重启eclipse试试
      

  6.   

    是的,方法都成功执行了,说明跳转的路径也是正确的。可问题就诡异出在我这个方法里面没有循环,为什么到return的时候不跳转呢。而是每次都执行3次。不多不少
      

  7.   

    这CSDN引用有问题、、、、、总是引用错