I have a method in my controller:
@RequestMapping(value="getData", method=RequestMethod.GET) @ResponseBody public List<MyDataObj> getData() { return myService.getData(); }
Data is returned as JSON or xsl, depending on the request.
If the person making the request is not allowed access to the data that I need to redirect the user to the "unauthorized" page, then something like this:
@RequestMapping(value="getData", method=RequestMethod.GET) @ResponseBody public List<MyDataObj> getData() { if (!isAuthorized()) {
All the examples I've seen using Spring require the method to return either String or ModelAndView . I was thinking about using HttpServletResponse.sendRedirect() , but all my JSPs are under WEB-INF and cannot be reached directly.
How can I refuse access to the data request url?
java redirect spring spring-mvc
Paul
source share