Servlet vs Applet
- An applet is a Java plug-in for web browser. Whereas servlet is a Java plug-in for web server.
- An applet extends the capabilities of web browser. Servlets are the Java components that extends the capabilities of web server.
- Applets adds functionality to web pages, but it has problems of compatibility & bandwidth issues.
- Applets are programs embedded directly into web pages with a web page; byte-code of an applet is downloaded to client box & executed by browser.
- For big size applets the download time is very high.
- To run an Applet, you must have compatible browser, but servlet code is being executed on server side & no issues with browsers compatibility or long download times.
Servlets are:
1. Portable – Write once, run anywhere.
2. Persistent – Can maintain states between requests. After loading it stays resident in memory while serving incoming requests.
3. Extensible – You can use object-oriented programs to reduce development time. Servlets can be run on any servlet enabled web server.
Response
Request
4. Efficient – Servlets initialization code is executed only 1st time server loads it. After this it will just call service method to handle request.
5. Powerful & Robust- Servlets can access entire JDK with class library that includes network support, file support, database access.
6. Versatile – Rich application program interface like relational database, distributed objects(RMI), Enterprise Java Beans etc.
Servlets are:
1. Portable – Write once, run anywhere.
2. Persistent – Can maintain states between requests. After loading it stays resident in memory while serving incoming requests.
3. Extensible – You can use object-oriented programs to reduce development time. Servlets can be run on any servlet enabled web server.
Response
Request
4. Efficient – Servlets initialization code is executed only 1st time server loads it. After this it will just call service method to handle request.
5. Powerful & Robust- Servlets can access entire JDK with class library that includes network support, file support, database access.
6. Versatile – Rich application program interface like relational database, distributed objects(RMI), Enterprise Java Beans etc.
No comments:
Post a Comment