aspose file tools*
The moose likes JSP and the fly likes Alternate to System.out.println Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Alternate to System.out.println" Watch "Alternate to System.out.println" New topic
Author

Alternate to System.out.println

kapil patel
Ranch Hand

Joined: Sep 30, 2005
Posts: 33
Hi,

I wanted to print message on System console from JSP page. I would not like to use System.out.println() as it is deprecated and also someone told me that it is not efficient and resume response time if we use very frequently.

I tried to search on internet without success. Your suggestion or guidance would be much appreciated.

Thanks,
Kapil Patel
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
You can use Log4j.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Originally posted by kapil patel:
I would not like to use System.out.println() as it is deprecated


Is not.

What is informally deprecated is the use of scriplets in a JSP page. If you are writing to modern standards, your page should have nothing to log.

That said, Log4J is a much perferable alternative to logging than System.out.println(), even if the latter is not deprecated.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sanjeev Singh
Ranch Hand

Joined: Nov 01, 2006
Posts: 381
kapil,
FYI... Log4j can be used with JSP also not by using scriptlets but by using taglibs.Jakarta has developed a taglibs for logging in JSP.
http://jakarta.apache.org/taglibs/doc/log-doc/log-1.0/index.html


~Sanjeev Singh<br />SCJP 1.5
kapil patel
Ranch Hand

Joined: Sep 30, 2005
Posts: 33
Thank you all.

Is there any alternative to log4j in case if our project people reluctant to add logging facility.
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
You can use application.log() in jsp file.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

Originally posted by kapil patel:
Is there any alternative to log4j in case if our project people reluctant to add logging facility.


Your question doesn't make much sense to me.

Either you want logging, or you don't. Which is it? Any alternative to Log4J is still logging.

If you'd rather not tie your project to a single logging system, you can do what I do and use Jakarta Commons Logging which can be used with either Log4J or java's built-in java.util.logging facility (or even a home-grown logging package).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Alternate to System.out.println