Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

request - service()

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the request comes, service method of which class will be called by the container

1. service(HttpServletRequest, HttpServletResponse) - HttpServlet Class
2. service(ServletRequest, ServletResponse) - Generic Servlet Class

If container uses 1 (HttpServlet Class) method then, is it necessary for the container to convert the response object into an HTTP response
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GenericServlet:service(ServletRequest request, ServletResponse response) gets called first, then passes the request to HttpServlet:service(HttpServletRequest request, HttpServletResponse response).

Note that GenericServlet:service() is public, while the HttpServlet:service() and the doXXX() methods are protected.

If container uses 1 (HttpServlet Class) method then, is it necessary for the container to convert the response object into an HTTP response



I'm not sure of what you mean by this.
 
kalle suresh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, In HFSJ
the diagram on page 43 (container converts the response object into an HTTP response )
and
the explanation on page 100 (the service method from the HttpServlet runs)

are contradicting.

If container uses 1 (HttpServlet Class) method then, is it necessary for the container to convert the response object into an HTTP response (Page 43).

Anyone can explain me.
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic