Adv - Java GTU Study Material Presentations Unit-4 Java Server Pages
Adv - Java GTU Study Material Presentations Unit-4 Java Server Pages
Advanced Java
Unit-4
Java Server Pages
Reference Book:
Professional Java Server Programming by Subrahmanyam Allamaraju, Cedric
Buest Wiley Publication
Chapter 10,11
3
Unit-4 Java Server Pages(JSP) 3 Darshan Institute of Engineering & Technology
What is Java Server Pages (JSP)?
Java Server Pages (JSP) is a technology for developing web pages
that support dynamic content.
It helps to insert java code in HTML pages by making use of special
JSP tags.
Example
<% …JSP Tag… %>
JSP is a server-side program that is similar in design and
functionality to java servlet.
A JSP page consists of HTML tags and JSP tags.
JSP pages are saved with .jsp extension
5
Unit-4 Java Server Pages(JSP) 5 Darshan Institute of Engineering & Technology
Comparing JSP with Servlet
JSP Servlet
JSP is a webpage scripting language that Servlets are Java programs that are already
generates dynamic content. compiled which also creates dynamic web
content.
A JSP technically gets converted to a servlet A servlet is a java class.
It embed the java code into HTML. It put HTML into print statements.
E.g. <html> <% java code %> </html> E.g. out.println(“<html code>”);
JSPs are extension of servlets which A servlet is a server-side program and written
minimizes the effort of developers to write purely in Java.
User Interfaces using Java programming.
JSP runs slower than servlet. Servlets run faster than JSP
As, it has the transition phase for converting
from JSP to a Servlet. Once it is converted to
a Servlet then it will start the compilation
9
Unit-4 Java Server Pages(JSP) 9 Darshan Institute of Engineering & Technology
Life Cycle of JSP
A JSP life cycle can be defined as the entire process from its
creation till the destruction.
It is similar to a servlet life cycle with an additional step which is
required to compile a JSP into servlet.
A JSP page is converted into Servlet in order to service requests.
The translation of a JSP page to a Servlet is called Lifecycle of JSP.
jspInit()
Request
Handles multiple
_jspService()
request/response
Response
jspDestroy()
Called
only once
Step:1
hello.jsp hello_jsp.java
Translation Step:2
from .jsp to Compilation of
servlet(.java) Servlet to bytecode
Web Container
Loading Servlet Class Step:3
Step:7
jspDestroy()
Request Time
Time taken to invoke a Servlet to handle an HTTP request is termed
as Request Time.
19
Unit-4 Java Server Pages(JSP) 19 Darshan Institute of Engineering & Technology
JSP Elements
JSP Element
22
Unit-4 Java Server Pages(JSP) 22 Darshan Institute of Engineering & Technology
JSP Scripting Elements
The scripting elements provides the ability to insert java code
inside the jsp. There are three types of traditional scripting
elements:
1. scriptlet tag
2. expression tag JSP Scripting Elements
3. declaration tag
Traditional Modern
scriptlet
EL Scripting
expression
declaration
comments
(html, jsp,java)
Syntax
<% // java source code %>
Example
<% out.print("welcome to jsp"); %>
“Do not end the statement with semicolon in case of expression tag.“
login.html
Scriptlet1.jsp
page directive
39
Unit-4 Java Server Pages(JSP) 39 Darshan Institute of Engineering & Technology
page directive
The page directive defines attributes that apply to an entire JSP
page.
You may code page directives anywhere in your JSP page.
By convention, page directives are coded at the top of the JSP
page.
Syntax
<%@page attribute="value" %>
Example
<%@page import="java.util.Date,java.util.List,java.io.*" %>
<%@page contentType="text/html; charset=US-ASCII" %>
include directive
45
Unit-4 Java Server Pages(JSP) 45 Darshan Institute of Engineering & Technology
include directive
JSP include directive is used to include the contents of another file
to the current JSP page during translation time.
The included file can be HTML, JSP, text files etc.
<%@ include attribute= "value" %>
Example
47
Unit-4 Java Server Pages(JSP) 47 Darshan Institute of Engineering & Technology
Jsp Implicit Objects
There are 9 jsp implicit objects.
These objects are created by the web container that are available to all the jsp
pages.
Implicit Object Type
out JspWriter
request HttpServletRequest
response HttpServletResponse
config ServletConfig
session HttpSession
pageContext PageContext
page Object
application ServletContext
exception Throwable
PrintWriter out= <html>
response.getWriter(); <body>
response.setContentType <% out.print(“DIET”); %>
(“text/html”); </body>
out.print(“DIET”); </html>
Welcome.jsp
hello,
<%
out.println(request.getParameter("login"));
%>
Welcome.jsp
<%
response.sendRedirect("www.darshan.ac.in");
%>
Config.html
<form action="MyConfig">
Login:<input type="text" name="login">
<input type="submit" value="sign_in">
</form>
Context2.jsp
<%
String name= (String)pageContext.getAttribute
("user",PageContext.APPLICATION_SCOPE);
out.print("Hello "+name);
%>
out.print("name is="+driver);
%>
${param.name}
${sessionScope.user}
EL1.jsp
1. Welcome, ${ param.name }
MyJSP.jsp MyErrorPage.jsp
<%@page errorPage=
<%@page isErrorPage
MyErrPage.jsp"%> ="true" %>
>%
2.jsp
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
99
Unit-4 Java Server Pages(JSP) 99 Darshan Institute of Engineering & Technology
JSP Cookie Handling
Cookies are text files stored on the client computer and they are
kept for various information tracking purpose.
JSP transparently supports HTTP cookies using underlying servlet
technology.
Unit-4 Java Server Pages(JSP) 100 Darshan Institute of Engineering & Technology
JSP Cookie Handling
<% Cookie cookie = new Cookie("c1","MyCookie1");
cookie.setMaxAge(60 * 60);
Cookie1.jsp
response.addCookie(cookie);
%>
<html><body>
<a href="Cookie2.jsp">Click here</a>
</body></html>
Cookie2.jsp
for(int i = 0; i < c2.length; i++) {
out.print("<p>"+c2[i].getName()+" "+
c2[i].getValue()+"</p>");
}
%>
Unit-4 Java Server Pages(JSP) 101 Darshan Institute of Engineering & Technology
JSP Session Handling
In JSP, session is an implicit object of type HttpSession.
The Java developer can use this object to set, get or remove
attribute or to get session information.
In Page Directive, session attribute indicates whether or not the
JSP page uses HTTP sessions.
<%@ page session="true" %> //By default it is true
Unit-4 Java Server Pages(JSP) 102 Darshan Institute of Engineering & Technology
JSP Session Handling
Session1.jsp
<%@page session="true" %>
<% session.setAttribute("s1","DIET");%>
<html>
<body>
<a href="Session2.jsp">nextPage</a>
</body>
</html>
Session2.jsp
Unit-4 Java Server Pages(JSP) 103 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
104
Unit-4 Java Server Pages(JSP) 104 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
The JSP Standard Tag Library (JSTL) represents a set of tags to
simplify the JSP development.
Advantages of JSTL
1. Fast Development: JSTL provides many tags that simplifies the
JSP.
2. Code Reusability: We can use the JSTL tags in various pages.
3. No need to use scriptlet tag: It avoids the use of scriptlet tag.
Unit-4 Java Server Pages(JSP) 105 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
Tag Library Function URI prefix
Core tag Variable support http://java.sun.com/jsp/jstl/core c
library Flow Control
Iterator
URL management
Miscellaneous
Unit-4 Java Server Pages(JSP) 106 Darshan Institute of Engineering & Technology
JSTL: Core tag library
The core group of tags are the most frequently used JSTL tags.
The JSTL core tag provides variable support, URL management,
flow control etc.
Unit-4 Java Server Pages(JSP) 107 Darshan Institute of Engineering & Technology
JSTL: Core tag library
Tags Description
c:out It display the result of an expression, similar to the way <%=...%> tag work.
c:import It Retrives relative or an absolute URL and display the contents to either a String in 'var',a
Reader in 'varReader' or the page.
c:set It sets the result of an expression under evaluation in a 'scope' variable.
c:remove It is used for removing the specified scoped variable from a particular scope.
c:catch It is used for Catches any Throwable exceptions that occurs in the body.
c:if It is conditional tag used for testing the condition and display the body content only if the
expression evaluates is true.
c:choose, It is the simple conditional tag that includes its body content if the evaluated condition is
c:when, true.
c:otherwise
c:forEach It is the basic iteration tag. It repeats the nested body content for fixed number of times or
over collection.
c:forTokens It iterates over tokens which is separated by the supplied delimeters.
c:param It adds a parameter in a containing 'import' tag's URL.
c:redirect It redirects the browser to a new URL and supports the context-relative URLs.
c:url It creates a URL with optional query parameters.
Unit-4 Java Server Pages(JSP) 108 Darshan Institute of Engineering & Technology
JSTL: Core tag library
1 c:out It display the result of an expression, similar to the way <%=...%>
tag work.
Unit-4 Java Server Pages(JSP) 109 Darshan Institute of Engineering & Technology
JSTL: Core tag library
2 c:import It is similar to jsp 'include', with an additional feature of including
the content of any resource either within server or outside the
server.
Unit-4 Java Server Pages(JSP) 110 Darshan Institute of Engineering & Technology
JSTL: Core tag library
3 c:set It is used to set the result of an expression evaluated in a
'scope'. This tag is similar to jsp:setProperty action tag.
Unit-4 Java Server Pages(JSP) 111 Darshan Institute of Engineering & Technology
JSTL: Core tag library
4 c:remove It is used for removing the specified scoped variable from a
particular scope
Unit-4 Java Server Pages(JSP) 112 Darshan Institute of Engineering & Technology
JSTL: Core tag library
5 c:if It is conditional tag used for testing the condition and display the
body content only if the expression evaluates is true.
Unit-4 Java Server Pages(JSP) 113 Darshan Institute of Engineering & Technology
JSTL: Core tag library
6 c:catch It is used for catching any Throwable exceptions that occurs in the body and
optionally exposes it.
Unit-4 Java Server Pages(JSP) 114 Darshan Institute of Engineering & Technology
JSTL: Core tag library
7 c:choose It is a conditional tag that establish a context for mutually
exclusive conditional operations. It works like a
Java switch statement in which we choose between a
numbers of alternatives.
c:when It is subtag of <choose > that will include its body if the
condition evaluated be 'true'.
c:otherwise It is also subtag of < choose > it follows <when> tags and
runs only if all the prior condition evaluated is 'false'.
Unit-4 Java Server Pages(JSP) 115 Darshan Institute of Engineering & Technology
JSTL: Core tag library Choose.jsp
Unit-4 Java Server Pages(JSP) 116 Darshan Institute of Engineering & Technology
JSTL: Core tag library
8 c:forEach It is an iteration tag used for repeating the nested body content for
fixed number of times. The < c:for each > tag is most commonly
used tag because it iterates over a collection of object.
Unit-4 Java Server Pages(JSP) 117 Darshan Institute of Engineering & Technology
JSTL: Core tag library
9 c:forTokens It iterates over tokens which is separated by the supplied
delimeters.
Unit-4 Java Server Pages(JSP) 118 Darshan Institute of Engineering & Technology
JSTL: Core tag library
10 c:url This tag creates a URL with optional query parameter. It is used for
url encoding or url formatting. This tag automatically performs the
URL rewriting operation.
Unit-4 Java Server Pages(JSP) 119 Darshan Institute of Engineering & Technology
JSTL: Core tag library
11 c:param It allow the proper URL request parameter to be specified within
URL and it automatically perform any necessary URL encoding.
Unit-4 Java Server Pages(JSP) 120 Darshan Institute of Engineering & Technology
JSTL: Core tag library
12 c:redirect tag redirects the browser to a new URL. It is used for redirecting the
browser to an alternate URL by using automatic URL rewriting.
1. <%@ taglib
uri="http://java.sun.com/jsp/jstl/core"
prefix="c" %>
2. <c:redirect url="http://darshan.ac.in"/>
Unit-4 Java Server Pages(JSP) 121 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
Tag Library Function URI prefix
Core tag Variable support http://java.sun.com/jsp/jstl/core c
library Flow Control
Iterator
URL management
Miscellaneous
Unit-4 Java Server Pages(JSP) 122 Darshan Institute of Engineering & Technology
JSTL -Function Tags List
The JSTL function provides a number of standard functions, most of
these functions are common string manipulation functions.
Syntax:
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
Unit-4 Java Server Pages(JSP) 123 Darshan Institute of Engineering & Technology
JSTL -Function Tags List
fn:contains It is used to test if an input string containing the specified substring
in a program.
fn:containsIgnoreCase It is used to test if an input string contains the specified substring as
a case insensitive way.
fn:endsWith It is used to test if an input string ends with the specified suffix.
fn:startsWith It is used for checking whether the given string is started with a
particular string value.
fn:toLowerCase It converts all the characters of a string to lower case.
fn:toUpperCase It converts all the characters of a string to upper case.
fn:length It returns the number of characters inside a string, or the number of
items in a collection.
fn:indexOf It returns an index within a string of first occurrence of a specified
substring.
fn:substring It returns the subset of a string according to the given start and end
position.
fn:replace It replaces all the occurrence of a string with another string
sequence.
fn:trim It removes the blank spaces from both the ends of a string.
Unit-4 Java Server Pages(JSP) 124 Darshan Institute of Engineering & Technology
JSTL -Function Tags List Function.jsp
Unit-4 Java Server Pages(JSP) 125 Darshan Institute of Engineering & Technology
JSTL -Function Tags List
Unit-4 Java Server Pages(JSP) 126 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
Tag Library Function URI prefix
Core tag Variable support http://java.sun.com/jsp/jstl/core c
library Flow Control
Iterator
URL management
Miscellaneous
Unit-4 Java Server Pages(JSP) 127 Darshan Institute of Engineering & Technology
JSTL-Formatting tags
The formatting tags provide support for message formatting, number
and date formatting etc.
Syntax
<%@ taglib uri="http://java.sun.com/jsp/jstl/
fmt" prefix="fmt"%>
Unit-4 Java Server Pages(JSP) 128 Darshan Institute of Engineering & Technology
JSTL-Formatting tags
Formatting Tags Descriptions
fmt:parseNumber It is used to Parses the string representation of a currency, percentage or
number.
fmt:formatNumber It is used to format the numerical value with specific format or precision.
Unit-4 Java Server Pages(JSP) 129 Darshan Institute of Engineering & Technology
JSTL-Formatting tags Number.jsp
Unit-4 Java Server Pages(JSP) 130 Darshan Institute of Engineering & Technology
JSTL-Formatting tags Number.jsp
7. <h3>Formatting of Number:</h3>
8. <p> Currency:
9. <fmt:formatNumber value="${Amount}" type="currency"
/></p>
10.<p>maxIntegerDigits_3:
11.<fmt:formatNumber type="number" maxIntegerDigits="3"
value="${Amount}" /></p>
12.<p>maxFractionDigits_5:
13.<fmt:formatNumber type="number" maxFractionDigits="6"
value="${Amount}" /></p>
14.<p>pattern###.###$:
15.<fmt:formatNumber type="number" pattern="###.###$"
value="${Amount}" /></p>
Unit-4 Java Server Pages(JSP) 131 Darshan Institute of Engineering & Technology
JSTL-Formatting tags
Unit-4 Java Server Pages(JSP) 132 Darshan Institute of Engineering & Technology
JSTL-Formatting tags
fmt:formatDate It formats the time and/or date using the supplied pattern and styles.
fmt:parseDate It parses the string representation of a time and date.
fmt:setTimeZone It stores the time zone inside a time zone configuration variable.
fmt:timeZone It specifies a parsing action nested in its body or the time zone for any time
formatting.
fmt:message It display an internationalized message.
Unit-4 Java Server Pages(JSP) 133 Darshan Institute of Engineering & Technology
JSTL-Formatting tags TimeZone.jsp
Unit-4 Java Server Pages(JSP) 134 Darshan Institute of Engineering & Technology
JSTL-Formatting tags TimeZone.jsp
Unit-4 Java Server Pages(JSP) 135 Darshan Institute of Engineering & Technology
JSTL-Formatting tags
Unit-4 Java Server Pages(JSP) 136 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
Tag Library Function URI prefix
Core tag Variable support http://java.sun.com/jsp/jstl/core c
library Flow Control
Iterator
URL management
Miscellaneous
Unit-4 Java Server Pages(JSP) 137 Darshan Institute of Engineering & Technology
JSTL SQL Tags List
The JSTL sql tags provide SQL support.
Syntax:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"
prefix="sql"
%>
Unit-4 Java Server Pages(JSP) 138 Darshan Institute of Engineering & Technology
JSTL SQL Tags List
SQL Tags Descriptions
sql:query It is used for executing the SQL query defined in its sql attribute or the
body.
sql:setDataSource It is used for creating a simple data source suitable only for prototyping.
sql:update It is used for executing the SQL update defined in its sql attribute or in the
tag body.
sql:param It is used to set the parameter in an SQL statement to the specified value.
sql:dateParam It is used to set the parameter in an SQL statement to a specified
java.util.Date value.
sql:transaction It is used to provide the nested database action with a common
connection.
Unit-4 Java Server Pages(JSP) 139 Darshan Institute of Engineering & Technology
JSTL SQL Tags List Sql.jsp
Unit-4 Java Server Pages(JSP) 140 Darshan Institute of Engineering & Technology
JSTL SQL Tags List Sql.jsp
Unit-4 Java Server Pages(JSP) 141 Darshan Institute of Engineering & Technology
JSTL SQL Tags List
Unit-4 Java Server Pages(JSP) 142 Darshan Institute of Engineering & Technology
JSP - Standard Tag Library (JSTL)
Tag Library Function URI prefix
Core tag Variable support http://java.sun.com/jsp/jstl/core c
library Flow Control
Iterator
URL management
Miscellaneous
Unit-4 Java Server Pages(JSP) 143 Darshan Institute of Engineering & Technology
JSTL-XML tag library
The JSTL XML tags are used for providing a JSP-centric way of
manipulating and creating XML documents.
The xml tags provide flow control, transformation etc.
Syntax:
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml"
prefix="x" %>
Unit-4 Java Server Pages(JSP) 144 Darshan Institute of Engineering & Technology
JSTL-XML tag library
XML Tags Descriptions
x:out Similar to <%= ... > tag, but for XPath expressions.
x:parse It is used for parse the XML data specified either in the tag body or an
attribute.
x:set It is used to sets a variable to the value of an XPath expression.
x:choose It is a conditional tag that establish a context for mutually exclusive conditional
operations.
x:when It is a subtag of that will include its body if the condition evaluated be 'true'.
x:otherwise It is subtag of that follows tags and runs only if all the prior conditions
evaluated be 'false'.
x:if It is used for evaluating the test XPath expression and if it is true, it will
processes its body content.
x:transform It is used in a XML document for providing the XSL(Extensible Stylesheet
Language) transformation.
x:param It is used along with the transform tag for setting the parameter in the XSLT
style sheet.
Unit-4 Java Server Pages(JSP) 145 Darshan Institute of Engineering & Technology
JSTL-XML tag library
1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%>
2. <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"
%>
3. <c:set var="myBook">
4. <books>
5. <myBook>
6. <title>TheSecret</title>
7. <author>RhondaByrne</author>
8. </myBook>
9. <myBook>
10. <title>Meluha</title>
11. <author>Amish</author>
12. </myBook>
13. </books>
14. </c:set>
Unit-4 Java Server Pages(JSP) 146 Darshan Institute of Engineering & Technology
JSTL-XML tag library
15. <x:parse xml="${myBook}" var="output"/>
16. <b>Name of the Book is</b>:
17. <x:out select="$output/books/myBook[1]/title" />
18. <p><b>Author of the Meluha is</b>:
19. <x:out select="$output/books/myBook[2]/author" /> </p>
20. <x:set var="myTitle"
select="$output/books/myBook[2]/title"/>
21. <p>x:set:<x:out select="$myTitle" /></p>
Unit-4 Java Server Pages(JSP) 147 Darshan Institute of Engineering & Technology
JSP Custom Tag
A custom tag is a user-defined JSP language element.
When a JSP page containing a custom tag is translated into a
servlet, the tag is converted to operations on an object called a tag
handler.
The Web container then invokes those operations when the JSP
page's servlet is executed.
JSP tag extensions let you create new tags that you can insert
directly into a JavaServer Page just as you would the built-in tags
Unit-4 Java Server Pages(JSP) 148 Darshan Institute of Engineering & Technology
How to create Custom Tag?
To create a custom tag we need three things:
1) Tag handler class: In this class we specify what our custom tag will
do, when it is used in a JSP page.
2) TLD file: Tag descriptor file where we will specify our tag name,
tag handler class and tag attributes.
3) JSP page: A JSP page where we will be using our custom tag
Defining
-Tag Name Business Logic of
Using Custom Tag -Tag handler class Tag
Unit-4 Java Server Pages(JSP) 149 Darshan Institute of Engineering & Technology
JSP Custom Tag
Defining
-Tag Name Business Logic of
Using Custom Tag -Tag handler class Tag
150
Unit-4 Java Server Pages(JSP) Darshan Institute of Engineering & Technology
Create the Tag handler class
Define a custom tag named <ex:Hello>
To create a custom JSP tag, you must first create a Java class that
acts as a tag handler.
So let us create HelloTag class.
Unit-4 Java Server Pages(JSP) 151 Darshan Institute of Engineering & Technology
Create the Tag handler class
1. import javax.servlet.jsp.tagext.*; HelloTag.java
2. import javax.servlet.jsp.*;
3. import java.io.*;
4. public class HelloTag extends SimpleTagSupport
5. {
6. public void doTag() throws JspException,
IOException
7. {
8. JspWriter out = getJspContext().getOut();
9. out.println("Hello Custom Tag!");
10. }
11.}
Unit-4 Java Server Pages(JSP) 152 Darshan Institute of Engineering & Technology
JSP Custom Tag
Defining
-Tag Name Business Logic of
Using Custom Tag -Tag handler class Tag
153
Unit-4 Java Server Pages(JSP) Darshan Institute of Engineering & Technology
Create TLD file
Tag Library Descriptor (TLD) file contains information of tag and Tag Hander
classes.
It must be contained inside the WEB-INF directory.
mytags.tld (Tag Library Descriptor)
1. <taglib>
2. <tlib-version>1.0</tlib-version>
3. <jsp-version>2.0</jsp-version>
4. <uri>WEB-INF/tlds/mytags.tld</uri>
5. <tag>
6. <name>Hello</name>
7. <tag-class>MyPackage.HelloTag</tag-class>
8. <body-content>empty</body-content>
9. </tag>
10.</taglib>
Unit-4 Java Server Pages(JSP) 154 Darshan Institute of Engineering & Technology
JSP Custom Tag
Defining
-Tag Name Business Logic of
Using Custom Tag -Tag handler class Tag
155
Unit-4 Java Server Pages(JSP) Darshan Institute of Engineering & Technology
JSP page
1. <%@taglib prefix="ex"
uri="WEB-INF/tlds/mytags.tld"%>
2. <html>
3. <body>
4. <ex:Hello/>
5. </body>
6. </html>
Unit-4 Java Server Pages(JSP) 156 Darshan Institute of Engineering & Technology