Professional Documents
Culture Documents
Why JSP
Why JSP
Java Server Pages (JSP) technology is that the Java platform technology for delivering
dynamic content to web clients in a portable, secure, and well-defined way. The Java
Server Pages specification extends the Java Servlet API to supply web application
developers with a strong framework for creating a dynamic web page on the server using
HTML, and XML templates, and Java code, which is secure, fast, and independent of server
platforms. JSP has been built on top of the Servlet API and utilizes Servlet semantics. JSP
has become the well-liked request handler and response mechanism. Although JSP
technology goes to be a strong successor to basic Servlets, they need an evolutionary
relationship and may be utilized in a cooperative and complementary manner.
In the initial days of servlets, sun Microsystems failed to attract ASP programmers towards
servlets. The reasons are:
To overcome the above problems Sun Microsystems has given a tag-based technology
called JSP having all the features of Servlet. So, any programmer can use JSP without
having strong knowledge of Java/Servlet.
JSP technology was designed to simplify the process of creating pages. It simplifies the
process by separating web presentations from web content. JSP is a collection of HTML
tags and JSP tags and Java code. Every JSP page is saved with extension .jsp. This JSP
can be placed in the root folder or WEB-INF. The JSP placed in the root folder is a public
resource and this resource can access by the client directly. The JSP placed inside WEB-
INF is a private resource, which can’t access directly by the client. Client access this
resource using public URL defined inside web.xml.
Servlets are powerful and sometimes they’re a touch cumbersome when it involves
generating complex HTML. Most servlets contain a touch code that handles application
logic and tons of more code that handles output formatting. This can make it difficult to
separate and reuse portions of the code when a special output format is required. For these
reasons, web application developers turn towards JSP as their preferred servlet
environment.
1. JSP is a Java standard technology that enables you to write dynamic, data-
driven pages for your Java web applications whereas SSI is a simple server-
side scripting language exclusively for the World Wide Web.
2. JSP uses servlets instead of a separate program to generate dynamic parts
as well as JSP allows for richer processing of form data. SSI invokes an
existing servlet and its output is inserted whole into a static page.
3. JSP is executed by the container’s JSP servlet whereas SSI is executed by
the webserver engine.
4. JSP is executed only once during JSP compile time whereas SSI is executed
on every request.
5. JSP works in JSP files only whereas SSI works in non-JSP files as well.
MVC was first described by Xerox in the late 1980s. The purpose of using MVC is to
separate components into three distinct units: The Model, the View, and the Controller. This
is a server-side implementation of a popular MVC design pattern.
The Model is the separation of the way application data is modeled; this is the data layer
that consists of the business logic of the system. It consists of all the data of the application
and represents the state of the application.
The View is from the way it is presented. It is a presentation Layer that normally presents
the UI of the application. It is used to display the data fetched from the controller. It shows
the data on the UI of the application.
In a server application, we commonly classify the parts of the appliance as business logic,
presentation, and request processing. Business logic is that the term used for the
manipulation of an application’s data, i.e., customer, product, and order information.
Presentation refers to how the appliance is shown to the user, i.e., the position, font, and
size. And finally, request processing is what ties the business logic and presentation parts
together. In MVC terms, the Model corresponds to business logic and data, the View to the
presentation logic, and therefore the Controller to the request processing.