How to check the value of a variable

I'm making a webapplication and I find it really hard to check the value of the variables? What is the best way to do this? I've tried using the debugger, but for some reason I can't get it to work properly.

How do the professionals do it? Do you write the value to the browser? Or do you write it to to the logfile?

I've tried writing to the browser, but in some of the classes, for instance in ejb-classes you don't have access to the writerobject, which makes the writing process really difficult.

What is the best way to do this?

[566 byte] By [vatora] at [2007-11-27 8:15:26]
# 1

Hi,

Better way is ofcourse debugging and professionals will follow it. If you are not able to configure the debugger then alternative would be logging the values to a log file. Use different levels of logging you can configure them in a property file. If you enable tracing in that file then all the trace commands will get executed and you can find the values in the log. Check how to configure log4j in your application.

Regards,

Rakesh

rakesh_mscita at 2007-7-12 20:00:12 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...