Servlets and Jsp’s
By Ramakrishna on Oct 16, 2008 in Java Interview Questions
A JavaServer Page, or JSP, consists of HTML with embedded Java code. When it
is requested, it is converted into a servlet and compiled by the JSP engine. Then, it
is run by the servlet engine.
–> A servlet is a Java class that runs on a server. For web applications, a servlet
extends the HttpServlet class. To pass HTML back to the browser, it uses the
println method of the out object.
–> When you develop a Java web application, you can use servlets for the processing
that’s required and JSPs for the page design.
–> You can develop servlets and JSPs on your own PC, on a network that functions as
an intranet, and on the Internet. When you use the Internet, you usually use a web
server that’s separate from the servlet and JSP engine.
–> As you develop a Java web application, you try to divide its classes into three
layers: presentation, business rules, and data access.
This makes it easier to manage and maintain the application.
