request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); List<Company> companyList = companyServiceImpl.getCompanyList(); request.setAttribute("companyList", companyList); //在这执行转发,companyList可以回显到jsp,下面的cs无法回显到jsp request.getRequestDispatcher("test.jsp").forward(request, response); Integer id = RequestUtil.getInt(request, "id"); System.out.println("id==========="+id); if (id != null) { CarSchool carSchoolListById = carSchoolServiceImpl.getCarSchoolListById(id); System.out.println("carSchoolListById============"+carSchoolListById); request.setAttribute("cs", carSchoolListById); } request.getRequestDispatcher("test.jsp").forward(request, response);
servlet的数据无法回显到一部分可以回显到jsp,一部分无法回显到jsp
最新推荐文章于 2022-12-15 19:23:28 发布