Java Server Pages(JSP)
Prof. Neeraj Bhargava
Kapil Chauhan
Department of Computer Science
School of Engineering & Systems Sciences
MDS University, Ajmer
What is JSP technology?
 JavaServer Pages (JSP) technology provides a simplified,
fast way to create web pages that display dynamically-
generated content.
 A JSP page is a page created by the web developer that
includes JSP technology-specific and custom tags, in
combination with other static (HTML or XML) tags.
Cont..
 JavaServer Pages (JSP) is a technology for developing
Webpages that supports dynamic content.
 This helps developers insert java code in HTML pages
by making use of special JSP tags, most of which start
with <% and end with %>.
 A JSP page consists of HTML tags and JSP tags.
A simple JSP page
 <html>
 <body>
 <% out.print(2*5); %>
 </body>
 </html>
A simple JSP page
<%@ page language=“java”%>
<%@ page contentType="text/html; charset=ISO-8859-1"%>
<html>
<head>
<title>A simple case</title>
</head>
<body bgcolor="#FFFFFF" >
<% String temp="the time now is:";%>
<%=(new java.util.Date()).toString()%>
</body>
</html>
Output screen
JSP’s implementation
*.class
request
response
jsp parser
JDK
*.jsp *.java
implementation
JSP - Architecture
Features of JSP
 Coding in JSP is easy
 Reduction in the length of Code
 Connection to Database is easier
 Make Interactive websites
 Portable, Powerful, flexible and easy to maintain
 Extension to Servlet
Disadvantages of using JSP
 Difficult to debug for errors.
 First time access leads to wastage of time
 It’s output is HTML which lacks features.
Assignment
 Explain Java Server Page(JSP) with example.

Jsp

  • 1.
    Java Server Pages(JSP) Prof.Neeraj Bhargava Kapil Chauhan Department of Computer Science School of Engineering & Systems Sciences MDS University, Ajmer
  • 2.
    What is JSPtechnology?  JavaServer Pages (JSP) technology provides a simplified, fast way to create web pages that display dynamically- generated content.  A JSP page is a page created by the web developer that includes JSP technology-specific and custom tags, in combination with other static (HTML or XML) tags.
  • 3.
    Cont..  JavaServer Pages(JSP) is a technology for developing Webpages that supports dynamic content.  This helps developers insert java code in HTML pages by making use of special JSP tags, most of which start with <% and end with %>.  A JSP page consists of HTML tags and JSP tags.
  • 4.
    A simple JSPpage  <html>  <body>  <% out.print(2*5); %>  </body>  </html>
  • 5.
    A simple JSPpage <%@ page language=“java”%> <%@ page contentType="text/html; charset=ISO-8859-1"%> <html> <head> <title>A simple case</title> </head> <body bgcolor="#FFFFFF" > <% String temp="the time now is:";%> <%=(new java.util.Date()).toString()%> </body> </html>
  • 6.
  • 7.
  • 8.
  • 9.
    Features of JSP Coding in JSP is easy  Reduction in the length of Code  Connection to Database is easier  Make Interactive websites  Portable, Powerful, flexible and easy to maintain  Extension to Servlet
  • 10.
    Disadvantages of usingJSP  Difficult to debug for errors.  First time access leads to wastage of time  It’s output is HTML which lacks features.
  • 11.
    Assignment  Explain JavaServer Page(JSP) with example.