Tuesday 24 April 2018

javax.servlet.ServletException: Circular view path

Problem :

javax.servlet.ServletException: Circular view path [error]: would dispatch back to the current handler URL [/latestOrder] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)



Solution :

You've annotated the controller method as producing JSON or String or any other object . You probably want to annotate the method with @ResponseBody and change its return type to allow you to return an object representation of the JSON that you want to include in the response


Preview:
  @RequestMapping(value="latestOrders",method = RequestMethod.GET)
    public @ResponseBody List<Order> listProducts(Model model) throws JMSException{
        List<Order> list=new ArrayList();
     list.add(staff1)
        return list;
    }

No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...