Difference between APPLET and SERVELT

Ques.IN JAVA WHAT IS DIFFERENCE BETWEEN APPLET AND SERVELT?
Ans.1) Applet is client side application whereas Servlet is Server side application.
2) An applet is a Java program that runs within a Web browser on the client machine whereas a servlet runs on the Web server.
3) An applet can use the user interface classes like AWT or Swing while the servlet does not have a user interface.
4) Servlet is a server, Applet is a browser.
5) Applet is a downloadable small program which runs on the client side and executed by the client's java enabled browser or by the Apllet viewer. It doesn't need main() method to begin the execution,instead it begin's its lifecycle where the name of the class is passed to the Appletviewer.. The Applet's lifecycle have 4 methods.

init()-Where it can initialise itself
start()- It can start running
stop()-stop running
destroy()-Cleanup process happens

Applets are treated as untrused and they have a limited permission to run in the client browser

Servlet can be treated as Server-side applets.It runs in a servlet container which is deployed in the webserver. The lifecycle of the servlet have 3 methods.

init()

If an instance of the servlet does not exist, the Web container
a. Loads the servlet class
b. Creates the instance of the servlet class
c. Initialise the servlet instance by calling the init() method

service()-invokes this method by passing request and response object and a subsequent call to the same servlet is invoked as thread

destroy()-If the servlet container decides to remove the servlet, it calls this method

People who read this post also read :



13 comments:

Great Post !!Clearly explained the difference :)

Thank you !! Very easy to understand !!!

Pls clear this doubt, Does applet need to be downlaoded every time it has to be executed,if i am right appication is one time downloadable.what is difference between app and applet.

Pls clear this doubt, Does applet need to be downlaoded every time it has to be executed,if i am right appication is one time downloadable.what is difference between app and applet.

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

Your differences between applet and servlet have explained clearly with good example.

Java Training in Chennai |
Best JAVA Training institute in Chennai

Thank you sharing the excellent post . you helped me to gain more information on the latest technique

Big data training in Chennai |
Hadoop training in velachery

Thanks for your informative article. Java is most popular programming language used for creating rich enterprise, desktop and web applications. Keep on updating your blog with such informative post. J2EE Training in Chennai | JAVA Training in Chennai| JAVA Course in Chennai

Testing an application is become essential for any product to get an effective result. Your post help you to gain more info on Selenium Testing

Selenium Training in chennai |
Selenium training institute in Chennai

Learned a lot of new things from your post! Good creation and HATS OFF to the creativity of your mind. Very interesting and useful blog!
Java Training in Chennai
Java Course in Chennai
Best Java Training in Chennai

There are lots of information about hadoop have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get to the next level in big data. Thanks for sharing this.Hadoop Training in Chennai | Big Data Training in Chennai

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More