Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

usage of generic servlet -- still not clear

 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I went through the existing archives to understand where do we use generic servlet ? I did not find clear answer.
I know that it is a base class for httpservelt.
In one of the postings, i read that it is used to create protocol independent servlet. What does it mean?
I would highly appreciate if anyone can answer my question with clear answer.
thanks.
 
jamel bal
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I advise you to read some about J2EE. And you will understant where the GenericServlet will be used other then a parent class for HttpServlet.
 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been working in J2EE projects. But i never came across writing generic servlets. That's why i am asking this question.
 
bobby chaurasia
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jyoti,
When the container receives a request it directs the request to the sevice( servletrequest, servletresponse) method which inturn calls its service( HttpServletRequest, HttpServletResonse) method. This method analyzes the request and passes it to apporiate doGet/doPost etc method.
I hope the utility of the generic service method is clear now.
Cheers!
 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bobby, thanks for your cheerful reply. But what i am saying is, I have been using httpservlets to handle http requests. Ofcourse, it has all these doGet(), doPost() methods. I know that it is not advised to override the service method in case of httpservlet.
Do u mean this itself is the usage of generic servlet ? Does it mean that the generic servlet handles the http requests ?
I would highly appreciate if u can clear my confusion.
 
deepa karkala
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bobby, someone asked me whether generic servlets handle http requests ? Where do we use generic servlets ?
I am in the impression that generic servlets can not handle http requests. We have to use http servlets to handle http requests.
Secondly, where do we use generic servlets ? Do we use it for ftp service or something similar ?
I am curious to find out the answers for this.
 
Weerawit Maneepongsawat
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think it's utility for any servlet and help about log or somethink like init() for any servlet
Fix me...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic