struts1.2中的ActionServlet类没有getDebug方法,请问我要怎样才能得到web.xml中的debug配置?谢谢! 官方下载的struts包里面,webapps目录下有个struts-documentation.war的文件,我想应该知道哪里能找到了吧。^_^很隐蔽哦~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 官方下载的struts包里面,webapps目录下有个struts-documentation.war的文件,我想应该知道哪里能找到了吧。^_^很隐蔽哦~ 晕,CSDN的论坛应该改进下了,解决一下重复提交的问题要不楼主还以为我穷得用这种方法要分呢 ^_^ 欢迎加入J2EEQQ群14672911.你会学到更多东西. 今天遇到这个问题,找到这里还是没有答案。后来在国外的论坛同样看到此问题:http://mail-archives.apache.org/mod_mbox/struts-dev/200510.mbox/%[email protected]%3e上面说Debug logging is now handled by commons-logging configuration. 据此,可以这样写:import org.apache.commons.logging.*;Log log=LogFactory.getLog(ActionServlet.class);boolean isDebug=log.isDebugEnabled();//判断是否debug状态//...-----------------------另:ActionServlet是HttpServlet的子类,所以也可以这样:int debug;try { debug=Integer.parseInt(servlet.getInitParameter("debug"));}catch(Exception ex) { debug=0; }if(debug>0){//...}//这个贴子是去年的了,还没有人回复,或许高手都挺忙的,不像我等闲人:) 为方便后来人,和寻找更优雅的实现,特此记录. SSH2 事务代理问题 请问30次左右的ResultSet开关会不会很蛋疼? 关于一条SQL语句用HIBERNATE的写法 hibernate 多线程运行 求实现j2ee实时消息的方法 给100分!请各位帮忙解决一个棘手问题! 请问哪位能提供jxl saveErrors问题 大家推荐几本学习J2EE的好书。 JBoss3X是个什么东东?(马上给分) 请教struts validator简单问题 请教一个问题,一个用strtus+tiles+hsql做的系统,要怎么样才能支持中文
^_^很隐蔽哦~
要不楼主还以为我穷得用这种方法要分呢 ^_^
后来在国外的论坛同样看到此问题:
http://mail-archives.apache.org/mod_mbox/struts-dev/200510.mbox/%[email protected]%3e
上面说Debug logging is now handled by commons-logging configuration.
据此,可以这样写:
import org.apache.commons.logging.*;
Log log=LogFactory.getLog(ActionServlet.class);
boolean isDebug=log.isDebugEnabled();//判断是否debug状态
//...
-----------------------
另:ActionServlet是HttpServlet的子类,所以也可以这样:
int debug;
try {
debug=Integer.parseInt(servlet.getInitParameter("debug"));
}catch(Exception ex) {
debug=0;
}
if(debug>0){
//...
}//这个贴子是去年的了,还没有人回复,或许高手都挺忙的,不像我等闲人:) 为方便后来人,和寻找更优雅的实现,特此记录.