JSP(Java Server Pages) Introduction

Java

JSP is a server side technology which is used to develop dynamic web application.

Server side technology means server(Web Server – Exa; Apache Tomcat) is responsible to execute JSP application.

JSP is an extension of Servlet technology, that means JSP containing some more functionality than Servlet like expression language, JSTL etc.

JSP application consists JSP tags and HTML tags.

JSP application converting into Servlet first before processing the client request.

By default Servlet API(that is two packages javax.servlet and javax.servlet.http) is available in JSP.

That’s why directly we are using implicit objects like request, response etc. in JSP.

The JSP file extension is .jsp and here a jsp file consider as presentation logic and business logic(process file) also.

 

Features of JSP:

JSP application is easy to develop.

Java Mid

Here code complexity is reducing.

Connecting with database is very easy. That means we can create and manage database through JSP easily.

JSP application making interactive websites.

JSP applications are browser and server independent, that’s why JSP application is portable, flexible and easy to maintain.

In this context, there is no need to re-deployment and no re-compilation.

 

Example of displaying a message:

index.jsp
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
out.println("welcome to JSP");
%>
</body>
</html>

 

web.xml
<welcome-file-list>
    <welcome-file>index.jsp </welcome-file>
  </welcome-file-list>
</web-app>

 

Output:
img

Share your love

Leave a Reply

Your email address will not be published. Required fields are marked *