Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Vendor Use Java Servlet Api and interfaces

 
murali vasu
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to understand How Java interfaces implementation are used vendors,
My Question is while Working with Servlet,When i write my Servlet i just implement
Servlet Interface and override Interface methods ? I Don't understand why i have to use servlet Interface,How My servlet is getting intailized ? can anyone pl explain with sample code how webserver vendor uses interface and Java API to make servlet working.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you'll quite understand it in one lil example. Check out Core Servlets and JavaServer Pages by our good friend Marty Hall. Since his newer book, "More Servlets and JavaServer Pages" came out, Marty's been kind enough to put a full electronic copy of Core Servlets online and available to download, for free.
Check out the first couple chapters -- they explain the basics of servlets and how they work.
 
Garrett Smith
Ranch Hand
Posts: 401
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you extend HttpServlet. It's an abstract class. Nonetheless, you ask a valid question, and a question which is (even after this) still unanswered.
Maybe you can check on the Jakara Tomcat Developer's list.
http://jakarta.apache.org/site/mail.html
I'd like to know, though, so post back here and let us know what you learned.

Garrett
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might I suggest that you download the source code for Apache Tomcat, read it and then answer the question yourself?
Kyle
 
murali vasu
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank U Guys..for prompt replies i would go thru u refer if find anything i will post it.
 
Hari babu
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By extending HTTpservlet You are writing your as per your specification. So every vendor knows how to instantiate your servlet. They do this by using class.forName("yourservlet").getInstance().
Remember this dynamic loading of the class can be done only if the clas can be instantiated with out any arguments
HTH
Hari
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic