File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Doubt  in servlet API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt  in servlet API" Watch "Doubt  in servlet API" New topic
Author

Doubt in servlet API

nidhivel raja
Ranch Hand

Joined: Jun 26, 2008
Posts: 36
Hi all,
I was browsing the Servlet API and i came across the Servlet interface.
There are many functions under the Servlet interface.Some of which are as follows


java.lang.String getServletInfo()
void init(ServletConfig config)
void service(ServletRequest req, ServletResponse res)
Each of these functions have different purposes,Some even return values.

An interface has no method implementations in it.
My Question is:
How can an Interface like Servlet have methods that return value without any implementations in them?Please do reply. Thank you in advane
sangram mhatre
Greenhorn

Joined: Apr 02, 2005
Posts: 15
Are you aware what an interface in java is ?
nidhivel raja
Ranch Hand

Joined: Jun 26, 2008
Posts: 36
Yes
Interface has is a group of method definitions .
nidhivel raja
Ranch Hand

Joined: Jun 26, 2008
Posts: 36
Originally posted by nidhivel raja:
Yes
Interface has is a group of method definitions .


Sorry for the mistake
Interface is a group of method definitions
Vijay Jeyam
Greenhorn

Joined: Nov 12, 2008
Posts: 15
Servlet is very generic and abstract. Servlet as a concept is not protocol specific. If you see some implementation for example implementation for HHTP protocol it comes with some implementaion as how to handle that. You can write some implementation that can handle FTP etc that will have the implementation.



The rest will be given by the user who is extending them(..business).


Never Never Never Give Up...!!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61199
    
  66

As with all other interfaces, a concrete class implements that interface. In the case of Servlet, the container defines and instantiates the concrete class.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nidhivel raja
Ranch Hand

Joined: Jun 26, 2008
Posts: 36
Thank you Mr.Sangram Mhatre, Mr.Vijay Jeyam and Mr.Bear Bibeault my doubt is cleared now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in servlet API