• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about static page

 
parra matta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the client requests for a static page, say index.html, who holds the responbility to retrieve the page and return it to the client? The web server or the servlet container?

In HFSJ, page 71, it says servlet container. Is it correct?

Thanks.
 
parra matta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, does the servlet container send the response to the client directly or it sends the response to the web server and the web server in turn sends the response to the client.

Thanks,
 
srinivas.rao marasu
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
client(HTML browser)never understands HttpServletResponse directly,In fact client generates it's request as HttpRequest, at the server side if dynamic content is supported then the container comes into picture,where in container converts HttpRequest into HttpServletRequest and proceeds on it way generates HttpServletResponse hand it over to WebServer,where in webServer converts it back HttpResponse sends it the Client(Html Browser).prov understands only HttpResponse.

Comming to static pages issue,for static pages we don't need
container at all,WebServer is enough like Apache,for static pages HttpRequest handles by the webServer and finds the right page according to the requested URL and sends back HttpResponse directly.In HeadFirst servlets and jsp in some diagrams they have not shown webServer in the diagram and they mentioned when ever you miss the webServer in the diagram,you assume it is there.
 
Gaurav Gambhir
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"client(HTML browser)never understands HttpServletResponse directly,In fact client generates it's request as HttpRequest, at the server side if dynamic content is supported then the container comes into picture,where in and proceeds on it way generates HttpServletResponse hand it over to WebServer,where in webServer converts it back HttpResponse sends it the Client(Html Browser).prov understands only HttpResponse.

Comming to static pages issue,for static pages we don't need
container at all,WebServer is enough like Apache,for static pages HttpRequest handles by the webServer and finds the right page according to the requested URL and sends back HttpResponse directly.In HeadFirst servlets and jsp in some diagrams they have not shown webServer in the diagram and they mentioned when ever you miss the webServer in the diagram,you assume it is there. "


Here above in whole discussion you are saying container converts HttpRequest into HttpServletRequest
HttpServletResponse to HttpResponse

Whats the difference between HttpRequest and HttpServletRequest
and HttpServletResponse and HttpResponse
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic