• 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

How Vendor Use Java Servlet Api and interfaces

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank U Guys..for prompt replies i would go thru u refer if find anything i will post it.
 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic