debugging in struts application

5.7k Views Asked by At

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..?

3

There are 3 best solutions below

0
Akhil K Nambiar On BEST ANSWER

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.

1
Joel On

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.

0
Ankit Zalani On

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