• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

question about static page

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic