-1

i'm new to struts... I have a struts form. i need to analyze the data posted to an action class. i just want to output the data to a page and stop further execution so as to test of it is working correctly... how is it done..?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Akhil K Nambiar
  • 3,835
  • 13
  • 47
  • 85

3 Answers3

2

There are many ways to debug a struts application:

  1. Configuration Plugin: You can use configuration plugin provided by struts. To use this plugin include struts2-config-browser-plugin-x.x.x.x.jar jar in your classpath and then you can use ">Launch the configuration browser anywhere in your application to view a lot of detail about the action class.

  2. The second way is to use Debugging Interceptor by using property debug=true in struts.xml.

See the below link for more details: http://struts.apache.org/release/2.2.x/docs/debugging-struts.html

Ankit Zalani
  • 3,068
  • 5
  • 27
  • 47
1

The easiest way to quickly and thoroughly inspect http requests and responses and post data is to use either:

  • http-fox with firefox (download)
  • chromes' network inspector (pre-installed with chrome - ctrl-shift-i - Network - Click on the appropriate post request and the body of the post will be displayed)

If neither of these very easy tools appeal, you'll have to find the appropriate hook to attach your debugger. I've not used struts since 2002 so cann't advise.

Joel
  • 29,538
  • 35
  • 110
  • 138
  • I'm sure there's an easier way, but if you include the source jar for struts you can set a breakpoint on something like ActionForm.validate and look at the HttpServletRequest http://struts.apache.org/1.x/apidocs/org/apache/struts/action/ActionForm.html#validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest) – Joel Mar 05 '11 at 11:31
-1

The best method is to use System.out.print and get the result in the tomcat console... i had said i need on server side not client side.

Akhil K Nambiar
  • 3,835
  • 13
  • 47
  • 85