日期:2014-05-18  浏览次数:20623 次

用jfreechart的问题!
我在serlet中调用写好的jfreechart 图片生成了,
但serlvet不能跳转了,网上说是response已经提交过
Cannot forward after response has been committed的错误!
下面是我在serlvet中doGET()的代码:

PrintWriter out = response.getWriter();
String c_name = request.getParameter("c_name");
String c_address = request.getParameter("c_address");
String rank = request.getParameter("rank");
System.out.println("B");
CustomerExpense ce = new CustomerExpense();
String filename = ce.generateStepRendererChart("客户", request.getSession(), out,c_name, rank, c_address);

System.out.println("filename" + filename);
request.setAttribute("filename", filename);
System.out.println("E");
out.close();
request.getRequestDispatcher("CustomerExpense.jsp").forward(request, response);


我想问下 我要在servlet中跳转到CustomerExpense.jsp该怎么办

------解决方案--------------------
Cannot forward after response has been committed

在response 已经提交后,不能再forward ,我也遇到过这问题,好好想想怎么解决吧