JSF(request response)对象的获取

xiaoxiao2022-06-12  53

import javax.faces.context.FacesContext; HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(); 下面的说明创建一个新页面! FacesContext facesContext= FacesContext.getCurrentInstance(); response.getWriter().print("OK!"); facesContext.responseComplete(); return null; 相关资源:Java 面经手册·小傅哥(公众号:bugstack虫洞栈).pdf
转载请注明原文地址: https://www.6miu.com/read-4933081.html

最新回复(0)