以下は私のコントローラーです
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public String ABC(Registratio registration, ModelMap modelMap,
HttpServletRequest request,HttpServletResponse response){
if(somecondition=="false"){
return "notok"; // here iam returning only the string
}
else{
// here i want to redirect to another controller shown below
}
}
@RequestMapping(value="/checkPage",method = RequestMethod.GET,)
public String XYZ(ModelMap modelMap,
HttpServletRequest request,HttpServletResponse response){
return "check"; // this will return check.jsp page
}
コントローラーABCは @ResponceBody 型であるため、常に文字列として返されますが、それ以外の場合はXYZコントローラーにリダイレクトされ、そこから表示できるjspページが返されるようにしたいと考えています。return "forward:checkPage";を使ってみました。また、 「redirect:checkPage」を返します。 しかし、うまくいきません。どんな助けでも。
ありがとう。