【1】struts2 debug两种方法

原文链接: http://struts.apache.org/release/2.3.x/docs/debugging-struts.html

方法一: Configuration Plugin 

步骤:

  1. 添加 struts2-config-browser-plugin-x.x.x.x.jar 到classpath下,如复制到WEB-INF\lib 下
  2. 在浏览器访问 项目下的 config-browser/index.action 即可查看配置信息

截图:

方法二:Debugging Interceptor

步骤:

  1. 在struts.xml 中启动调试模式   <constant name="struts.devMode" value="true" />
  2. 在访问需要调试的action时在后面加上参数debug=参数      其中参数为xml, console, command, 或者 browser ,不同参数表示以不同形式展现调试信息
  3. 当debug=browser时需要在classpath下添加struts2-dojo-plugin-x.x.x.jar,并在该action返回的jsp页面的<head></head>之间添加<s:head /> 才能保证页面expand和collapse正确工作
  4. debug=browser显示的信息比较友好,推荐

截图

  1. debug=browser将在浏览器显示action信息
  2. debug=xml在浏览器中以xml格式显示action信息
  3. debug=console和debug=command浏览器显示正常工作逻辑的jsp。并在控制台输出action信息,两种方法有什么区别暂时不了解
原文地址:https://www.cnblogs.com/qiudeqing/p/3073333.html