来源:自学PHP网 时间:2015-04-14 14:51 作者: 阅读:次
[导读] OGNL会执行执行安全检测,但是并不被GAE所支持,解决方法是创建一个监听器,将安全检查处理器置空OgnlRuntime.setSecurityManager(null);web.xml添加listenerlistener-classcom.llx.gps.listener.Struts2Lis......
OgnlRuntime.setSecurityManager(null);
web.xml添加
<listener> <listener-class>com.llx.gps.listener.Struts2ListenerOnGAE</listener-class> </listener> package com.llx.gps.listener; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; import ognl.OgnlRuntime; public class Struts2ListenerOnGAE implements ServletContextListener, HttpSessionListener, HttpSessionAttributeListener { public void contextInitialized(ServletContextEvent sce) { OgnlRuntime.setSecurityManager(null); } @Override public void contextDestroyed(ServletContextEvent arg0) { // TODO Auto-generated method stub } @Override public void sessionCreated(HttpSessionEvent arg0) { // TODO Auto-generated method stub } @Override public void sessionDestroyed(HttpSessionEvent arg0) { // TODO Auto-generated method stub } @Override public void attributeAdded(HttpSessionBindingEvent arg0) { // TODO Auto-generated method stub } @Override public void attributeRemoved(HttpSessionBindingEvent arg0) { // TODO Auto-generated method stub } @Override public void attributeReplaced(HttpSessionBindingEvent arg0) { // TODO Auto-generated method stub } }
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com