从角度控制器访问数据到Spring控制器

时间:2018-03-19 18:44:15

标签: java angularjs spring

弹簧控制器

@RequestMapping(value = "/saveNamedDrivers", method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE)
public ModelAndView saveNamedDrivers(QuotationDO user, HttpServletRequest request, HttpSession session,HttpServletResponse response) {
 //public String signUp(@RequestBody QuotationDO user){ 
    System.out.println("1234567890");


    System.out.println((user));
    return new ModelAndView("premium/premium");
}

index.js

$http({
                method: 'POST',
                url: CONTEXT_PATH + 'saveNamedDrivers',
                headers: {
                    'Content-Type': 'application/json', 
                    'Accept': 'application/json'
                },
                data:JSON.stringify($scope.user)
            })

如何访问java中的DO对象我获取了print语句的空数据?

here is the image field getter is returning NULL

0 个答案:

没有答案