• Post Reply Bookmark Topic Watch Topic
  • New Topic

can we write a program by implementing servlet?

 
kiran kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I mean we can write servlet program by extending GenericServlet and HttpServlet ,is it possible by implementing Servlet ?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raul, I'm not sure what you're asking.
Could you explain your question in a little more detail?
 
Tim Holloway
Bartender
Posts: 18413
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. In fact, the whole architecture is designed for general-purpose request/response serving. It's just that the most common implementation of that particular paradigm is HTTP.

What you get from HttpServlet is additional functions that understand the specific needs of an HTTP server. If my memory is any good, among other things, that means that the raw Servlet's service() method is overridden and replaced with on that calls doGet() or doPost() depending on whether the incoming HTTP request is a GET or a POST.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you can do it by implementing all of Servlet's methods

such as service(),getServletInfo(),getServletConfig(),init(config)
destroy()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!