Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question about syntax in Head First Servlets & JSP  RSS feed

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently reading Ch3 and duplicate the web app on my computer in this chapter. How come in the Servlet code and Model source code it use out.print instead of System.out.print? Did the code implement static import? Can someone point this out to me?

Thank you
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without the book, I can't tell for sure, but I guess that it gets the output stream using the ServletRequest. Look at getWriter's method. Basically speaking, the output stream corresponds to your web page, but System.out does not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!