0
我正在使用Seam应用程序。我试图从FacesContext获取ResponseWriter,但我得到了NullPointerException
。在试图从FacesContext获取ResponseWriter时在Seam中获取NullPointerException
我可以通过调用
FacesContext context = FacesContext.getCurrentInstance();
根据调试器获得一个FacesContext,在FacesContext对象的responseWriter变量为空,因此调用
ResponseWriter writer = context.getResponseWriter();
给人以NullPointerException
。
为什么ResponseWriter会为空?默认为空吗?我们可以在我们的代码中的很多其他地方从FacesContext中获得它。
有没有办法可以手动设置?
无论如何感谢您的答复。 – Eric 2011-03-17 17:16:12