Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFJS-page 43

 
Prets Joshua
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I'm the new one to join this group..This site just rocks..

I have completed my SCJP certification and currently preparing for SCWCD. And bought HFJS book. I'm still at the start of this book and got this doubt. On page 43, it is mentioned that its the container that converts the resposed object into HTTP response and sends it back to the client.

However on page 62 the answer for Converts a response object to an HTTP response is given as the Web Server.

I would like someone to clarify this to me.

Thanks,
Prets.
 
Mat Williams
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome aboard.

I don't have the book in front of me so I may be wrong, however I am guessing that the Authors are assuming that the web server is also the container, as in Tomcat. I think they base all their examples on Tomcat as it is the reference implementation for JSP 2.0 and Servlets 2.4.

If the web server and the container are not the same then the process is as follows

client -> web server (sends request)
web server -> container (passes request through)
container processes request
cotainer -> web server (generally passes a web page and associated headers back, headers may be cookies etc)
web server -> sends response back to client.

The Web Server cannot convert a Response object to html unless it is also the container, it not even guaranteed to be a java app (and in most cases isn't).

HTH

Mat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic