A servlet is nothing but Java code that runs in a container. It generates HTML & other contents that get displayed in the web page that we see. It is purely coded in Java, so the benefits and restrictions of all regular Java classes apply here too. Servlets are compiled to form a platform neutral bytecode (All java code is platform neutral, isnt it? Serlvet is no different). Upon request, this bytecode file is loaded into a container. Some containers (servlet engines) are integrated with the Web server, while others are plug-ins or extensions to Web servers that run inside the JVM. Servlets look the same as static Web pages to the client, but they really are complete programs capable of complex operations.
Chat with our AI personalities
barsanabegam
It is a good to know item. It is not mandatory or necessary. Basic knowledge of core Java is enough to learn JSP and Servlets.
SERVLETS JSP 1. Servlet is a java class. 2. Servlet is a single instance multiple thread web application, In which HTML code can be included in java code. 3. In servlets the presentation logic and the B.logic is tightly coupled. 4. For every modification done in servlet program, we need to recompile and reload the application. 5. In servlets implicit objects are not available. 6. Servlets are supported to HTTP, FTP, and SMTP protocols. 7. Sevlets are need Deployment Descriptor file (web.xml) 1. Jsp is a file. 2. In jsp java code can be included in HTML code by using special tags. 3. In jsp's the presentation logic and B.logic are separated by defining the java beans. 4. If any modifications done in jsp's without recompiling and reloading , the modifications are reflected. 5. In jsp's implicit objects are available which is we can implement directly into jsp pages. 6. Jsp are supported to HTTP protocol only. 7. No need of Deployment Descriptor file (web.xml) [email protected]
No. But, knowledge of Servlets would be an added advantage if you are learning JSPs
You cannot. You display JSP Pages using the help of Servlets. Servlets are of the background classes and you cannot display them