Problem with printing debug statements in JSP page

Hi all,

I am debugging an application with System.out.println() statements - my debug statements in the *.java class printed just fine, but when I do the same thing in my JSP page, nothing gets printed out.

I am already wrapping my System.out.println() statements inside the <% %> tag.

Does anyone know what may be causing this? Any help will be greatly appreciated!

- JL

[408 byte] By [Joel.La] at [2007-11-26 19:05:00]
# 1

Where do you expect to see the output?

System.out.println will write to the console/logs

They WON'T write to the JSP page.

If you check your error/output logs you will probably find the statements there.

If you want to print things into the JSP page, just use out.println.

"out" is an implicit reference to the current JSPWriter.

Cheers,

evnafets

evnafetsa at 2007-7-9 20:54:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi,

Thanks for your reply. I checked in the stdout log that my debug statements in my *.java class file printed to, so I'm sure I'm looking at the right place.

Nothing gets printed in that file when I put the same debug statement in my JSP file though.

It was something as simple as System.out.println("Hello"),

Thanks,

JL

Joel.La at 2007-7-9 20:54:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Ok, what server are you using? Tomcat?

What version?

Are you using Log4j, or any other logging tools as part of this app?

Your java class is being called as part of the server web request?

Are you sure that the debugging statements are being deployed to your web app? Maybe it is not getting the new copy of the JSP with the debugging statements in it?

evnafetsa at 2007-7-9 20:54:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Hi,

1. I'm using Tomcat 5.5

2. I see Log4j in the code but I'm not familiar with it. Is it better than placing System.out.println() as debug statements?

3. My java class is called from my JSP page as part of the request.

4. I have checked the deployed JSP page and saw my debug statements.

Many thanks!

Joel.La at 2007-7-9 20:54:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi,This is resolved now. I've read up on Log4j and was able to use it. The debug statements show up a lot nicer than standard System.out.println().evnafets, thank you for all your help.- JL
Joel.La at 2007-7-9 20:54:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...