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
    关注

    你是不是少配置了啥

    评论

报告相同问题?

悬赏问题

  • ¥15 Opencv配置出错
  • ¥15 模电中二极管,三极管和电容的应用
  • ¥15 关于模型导入UNITY的.FBX: Check external application preferences.警告。
  • ¥15 气象网格数据与卫星轨道数据如何匹配
  • ¥100 java ee ssm项目 悬赏,感兴趣直接联系我
  • ¥15 微软账户问题不小心注销了好像
  • ¥15 x264库中预测模式字IPM、运动向量差MVD、量化后的DCT系数的位置
  • ¥15 curl 命令调用正常,程序调用报 java.net.ConnectException: connection refused
  • ¥20 关于web前端如何播放二次加密m3u8视频的问题
  • ¥15 使用百度地图api 位置函数报错?