海蓝啸 发表于 2008-1-10 10:32

看看我这个错误怎么回事

-------------------------------------------------------------------------------------------------------

            [color=Blue]User loginUser = UserService.login(code, pwd);
                // 向session存储登陆用户信息
               HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext
                                    ().getSession(false);// .getSession(false);
             session.setAttribute("loginUser", loginUser);
                // 进入下一个页面master
             FacesContext context=FacesContext.getCurrentInstance();
             HttpServletResponse response=(HttpServletResponse)context.getExternalContext().getResponse();
             response.sendRedirect("../main/master.jsf");[/color]

--------------------------------------------------------------------------------------------------------

以上是我程序的一段代码,执行后转入到master页面,但是运行报错[color=Red]Cannot forward after response has been committed[/color]
各位可知道怎么回事?

海蓝啸 发表于 2008-1-10 10:54

搞定了。。。新页面路径写错了

页: [1]

编程论坛