qq_38062838 2021-02-17 21:14 采纳率: 25%
浏览 191

return 跳转不了templates 里面的页面

没有报错

//这只前端 的

 <script type="text/javascript">

        function getCartList() {

            debugger
            var token=localStorage.getItem("login-user");

            location.href="http://localhost/shop-car/carController/getUserCarList?token="+token;


        }

这是前端接口返回的数据

只是返回这个

这是后端java代码

  @RequestMapping("/getUserCarList")
    @LoginUser

    public String getUserCarList(@CookieValue(name = ShopConstants.ANON_ID,required = false) String anonId, User user, Car car, HttpServletResponse response, Model model){
    List<Car> carList=null;
        EntityWrapper entityWrapper=new EntityWrapper();
        entityWrapper.eq("uid",user.getId());



        carList=carService.selectList(entityWrapper);//查当前用户的
        System.out.println(carList+"x22xxxxxxx");
        BigDecimal totalPrice=findCarGoodsInfo(carList);
        model.addAttribute("carList",carList);
        model.addAttribute("totalPrice", totalPrice);
        System.out.println("3333333333333333333333333333333");
       // return "redirect:/carList.html";
             return "carList";//没有跳转页面
        //  return new ModelAndView("carList.html");
    }

页面没有跳转哪里错了呢 试了好几种就是没有成功

  • 写回答

2条回答 默认 最新

  • APX456 2021-02-18 09:49
    关注

    你是不是少配置了啥

    评论

报告相同问题?