Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

In JSP + Jdbc web page can "System.out.println()" can be used?  RSS feed

 
gyan kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In below program


Is it correct to use System.out.println() or out.println should be used it I want to show on web page.
 
mgupta gupta
Greenhorn
Posts: 3
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The correct way to show on web page is out.println(). System.out.println() will print result on server console not on web page.
 
Tim Moores
Saloon Keeper
Posts: 3512
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Several comments, no specific order:

You should not have Java code in JSP pages; put that in backing beans or servlets.

The JDBC/ODBC bridge driver you're using is not thread-safe; using it in web apps is bound to cause problems.

You should get in the habit of using a configurable logging system such as java.util.logging or log4j; System.out.println is OK for example code but not for production use.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!