This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes What is the difference between a servlet class and a java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "What is the difference between a servlet class and a java class" Watch "What is the difference between a servlet class and a java class" New topic
Author

What is the difference between a servlet class and a java class

Nishin Kareem
Greenhorn

Joined: Oct 12, 2012
Posts: 3
What is the difference between a servlet class and a java class. Please help me!
dharmendra kumar Pandey
Greenhorn

Joined: Oct 12, 2012
Posts: 1
a servlet class too is a java class, the question should be what type of class is a servlet
Nishin Kareem
Greenhorn

Joined: Oct 12, 2012
Posts: 3
question was like what is the difference between servlet and java class.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to CodeRanch Nishin Kareem and dharmendra !

-->Servlet is a java class which comply servlet specification, so that it can be run in a server. Java class not required to comply Java Servlet API. - putting this point awkwardly

some other rancher may help you better.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4376
    
    8

Hi Nishin and Dharmendra. Welcome to the Ranch!

A servlet class is just the same as any other Java class. As far as the language is concerned, it's not treated any differently.

The difference is what is done to them. A servlet container (e.g. Tomcat) is designed to be able to recognise servlet classes and, if configured correctly, treat them in a particular way. There's nothing magical about this - you can always write your own application that can treat any type of class in a specific way - but there's a standard that all servlet containers follow that means you can write a servlet class and know how it will be used.
Nishin Kareem
Greenhorn

Joined: Oct 12, 2012
Posts: 3
Thanks a lot Matthew Brown/Seetharaman Venkatasamy.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Nishin Kareem wrote:Thanks a lot Matthew Brown/Seetharaman Venkatasamy.

You are welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the difference between a servlet class and a java class