請教大家spring mvc的action轉發問題

bonepole發表於2008-11-04
程式碼如下:
@Controller
@RequestMapping("/checkerAction.do")
public class CheckerAction {

@Autowired
private CheckerService checkerService;

@RequestMapping(params = "method=showAllChecker")
public String showAllChecker(ModelMap model){
List<Checker> checkers = checkerService.listAllChecker();
model.addAttribute("checkers",checkers);
return "checker";
}

@RequestMapping(params = "method=deleteChecker")
public void deleteChecker(){
Checker c = new Checker();
c.setCheckerName("test");
checkerService.deleteChecker(c);
}
}

執行http://localhost:8080/demo/checkerAction.do?method=deleteChecker後,轉發到checkrAction.do?method=showAllChecker去執行showAllChecker方法,請問怎麼寫註解?謝謝幫助!

相關文章