FacesContext.getCurrentInstance() 返回NULL
来源:互联网 发布:中国知网论文数据库 编辑:程序博客网 时间:2024/06/10 14:53
FacesContext facesContext=FacesContext.getCurrentInstance();
这句代码报错,百思不得求解
解决方法:
<form name="form1" action='<c:url value="/sys_permission/psetprivilege.faces"/>' method="post">
<input type="hidden" id = "result" name="result" value="<%=tmp %>" />
<input type="hidden" id = "delete" name="result" value="5,11,41,61,68,82,110,125,140,150,243,275,280,286,290,310,802,803," />
<input type="hidden" name="roleid" value="<%=roleid%>" />
<input type="submit" name="Submit" value="保存权限" onclick="childShowSysInform();" />
</form>
解决思路:
FacesContext 是JSF框架中的类,直接Action提交到JSP页面,根本没有经过如下Servlet,后缀名修改为faces,问题成功解决。
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
解决人: 李虎军
总结:
对框架使用的理解,对WEB.XML的理解,对过滤器的理解。对FacesContext的生命流程理解,逻辑判断能力,实在是让我好生敬佩。
- FacesContext.getCurrentInstance() 返回NULL
- java.lang.IllegalArgumentException: FacesContext must not be null 错误分析及解决
- getLastKnownLocation 返回null
- findViewById()返回 null
- findViewById返回null
- Andorid findViewById()返回Null
- findViewById()返回null
- getLayoutParams 返回null
- GetProcAddress返回NULL
- AfxGetMainWnd返回NULL
- findViewById返回Null 错误
- findViewById 返回null
- scheme null?返回值
- mysql_fetch_row 返回NULL
- AfxGetMainWnd返回NULL
- cvCreateFileCapture返回值 NULL
- AfxGetMainWnd()返回NULL
- GETMODULEHANDLE总是返回null
- Asp.net用ajax技术实现无刷新分页
- 细谈volatile限定符——上海先锋商泰面试归来
- 给定前序中序遍历,求后续遍历
- 调节亮度、对比度及gamma值实现彩色图像的亮度变换
- 修改Magento后台管理目录
- FacesContext.getCurrentInstance() 返回NULL
- SQL 练习总结
- [转载]结构体定义 typedef struct 用法详解和用法小结
- 解决gridview导出到excel中汉字出现乱码的问题
- 制作自己的ubuntu安装光盘
- CCNA实验五 配置路由器为DHCP服务器
- 44B0中断原理详解
- 尾调用(Tail Call)和尾递归(Tail Recursive)
- Ubuntu标题栏消失问题