Spring mvc的 ModelAndView的这个地址根本不存在,为什么还是能正常打开?


@RequestMapping(value = "/add", method = RequestMethod.POST)


 public ModelAndView add(HttpServletRequest request,
        HttpServletResponse response, zqbp_custom item) {
    ConnectionSource connectionSource = DBUtil.getConnectionSource();
    try {
        String []a=item.getCustom_address().split(",");
        String aa="";
        for(int i=0;i<a.length;i++){
            if(Integer.parseInt(a[i])!=-1){
            if(a[i]!=null){
                if(i!=4){
            Dao<t_prov_city_area_street, String> dao = DaoManager.createDao(connectionSource,
                    t_prov_city_area_street.class);
            t_prov_city_area_street t=dao.queryForId(a[i]);

            aa+=t.getName();
            }else{
                aa+=a[i];
            }
            }
            }
            }
        Dao<zqbp_custom, String> dao = DaoManager.createDao(connectionSource,
                zqbp_custom.class);
        item.setCustom_id((UUID.randomUUID().toString().replaceAll("-", "")));
        item.setStatus("0");
        item.setCustom_address(aa);

        item.setCustom_trade("3");
        dao.create(item);
        connectionSource.close();
    } catch (SQLException e) {
        return jsonError(request, "保存失败!!", "");
    }
    return jsonSuccess(request, "保存成功!", getBasePath(request)

  • "admin/custom/index.html");

      
       }
      
     

    《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
    ModelAndView的正确地址应该是admin/Custom/Index.jsp"
    绝对不是什么缓存的问题

spring-mvc java javaweb mvc spring

AKili 9 years, 1 month ago

最后的.html 跟jsp一样的

镜音Len answered 9 years, 1 month ago

Your Answer