I have something to login ajax through spring security:
@RequestMapping(value="/entry.html", method=RequestMethod.GET)
public String getEntry(){
return isAuthenticated()? "redirect:/logout.jsp":"entry";
}
@RequestMapping(value="/postLogout.html", method=RequestMethod.GET)
public @ResponseBody String getPostLogout(){
return "{success:true, logout:true, session:false}";
}
The flow is that when it receives a call in /entry.html, it checks and selects
- redirect to
/logout.jsp=> using spring security and then redirect to /postLogout.html=> JSON response - allow view
entry, which is jsp, contains only json string
I would like to know if I can use @ResponseBodyin getEntry()without using jsp to write only json values?
source
share