What is the difference between servlets and applets?

1.Servlets executes on Servers, where as Applets executes on Browser
2.Servlets have no GUI, where as an Applet has GUI
3.Servlets creates static web pages, where as Applets creates dynamic web pages
4.Servlets can handle only a single request, where as Applet can handle multiple requests

Options
- 1,2,3 are correct
- 1,2 are correct
- 1,3 are correct
- 1,2,3,4 are correct


CORRECT ANSWER : 1,2 are correct

Discussion Board
Servlets vs. applets

The answer number 1 and 2 is correct as applet is a program written in Java that embeds in HTML page. It is run on the browser and can be used to view the web page containing the applet. Whereas servlet is a Java program which improves/ extend the functionalities of a server.

When an applet is viewed the code is transferred to the user computer and executed on JVM (Java Virtual Machine). Whereas in case of servlets the server should be accessed by the host applications using the request-response model.

Applets provide the user interactive features that might not be possible to provide using only HTML. Whereas servlets don't provide any GUI based features as it involves server side scripting.

Rohit Sharma 11-27-2014 03:04 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement