使用Struts 2开发应用05:程序调试
2016-03-23 10:31
531 查看
文章翻译自Struts 2官方文档。
现代IDE提供了优秀的程序调试支持。此外,框架提供了在运行时查看框架对象的支持。
调试拦截器提供了三种洞察页面背后的数据的调试模式。
xml模式用XML文档格式化相关的框架对象。
console模式提供了一个接受运行时表达式的OGNL命令行,
browser模式添加一个显示来自值栈(Value Stack)的对象的交互页面。
为了使用调试功能,首先确保
struts.devMode的值已经通过struts.properties文件或
struts.xml文件设置为了
true,像这样:
<constant name="struts.devMode" value="true" />
然后,当页面需要调试时,在URL上添加
?debug=xml或者
?debug=console或者
?debug=browser。
- <debug> <parameters /> - <context> - <struts.actionMapping> <class>class org.apache.struts2.dispatcher.mapper.ActionMapping</class> <name>showcase</name> <namespace>/</namespace> </struts.actionMapping> <attr /> <__devMode>true</__devMode> <report.conversion.errors>false</report.conversion.errors> </context> <request /> <session /> - <valueStack> - <value> <actionErrors /> <actionMessages /> <class>class com.opensymphony.xwork2.ActionSupport</class> <errorMessages /> <errors /> <fieldErrors /> - <locale> <ISO3Country>USA</ISO3Country> <ISO3Language>eng</ISO3Language> <class>class java.util.Locale</class> <country>US</country> <displayCountry>United States</displayCountry> <displayLanguage>English</displayLanguage> <displayName>English (United States)</displayName> <displayVariant /> <language>en</language> <variant /> </locale> </value> - <value> <class>class com.opensymphony.xwork2.DefaultTextProvider</class> </value> </valueStack> </debug>
对于
?debug=xml,使用Internet Explorer浏览器或者在FireFox中使用IE标签。
对于
?debug=console,你可能需要放宽任意的弹出阻断。
相关文章推荐
- Unix/Linux C++应用开发-gdb调试工具使用
- Windows mobile 开发入门—第一个程序"hello world",链接调试,模拟器的使用
- Android 软件开发之如何使用Eclipse Debug调试程序详解
- 微软MSDN给出的使用.Net开发Windows Form网络应用相关程序的优化建议
- Android 软件开发之如何使用Eclipse Debug调试程序详解
- [IOS 开发] 使用断言NSAssert()调试程序错误
- 使用ARM DS-5的debugger进行ARM的裸板程序的开发,调试,优化
- 使用GDB调试Android NDK开发的程序
- Android开发笔记之:一分钟学会使用Logcat调试程序的详解
- Struts1应用、实现简单计算器、使用DispatchAction、显示友好的报错信息、使用动态Form简化开发
- Android 软件开发之如何使用Eclipse Debug调试程序详解(十二)
- Android 软件开发之如何使用Eclipse Debug调试程序详解
- 【Android 开发入门】使用Android模拟器预览调试程序
- 如何使用IE浏览器自带开发人员工具调试JS程序?
- Android 软件开发之如何使用Eclipse Debug调试程序详解及Eclipse常用快捷键(转)
- 使用VS开发WindowsPhone7应用同时运行两个模拟器调试
- [GDB]_[命令行使用gdb调试程序简单应用]
- 使用Seam Framework + JBoss 5.0 开发第一个Web应用 - 简单投票程序
- 使用串口模拟工具进行串口程序开发调试
- Android 软件开发之如何使用Eclipse Debug调试程序详解(十二)