BCA AWT Unit 5
BCA AWT Unit 5
A JSP page consists of HTML tags and JSP tags. The JSP pages are easier to
maintain than Servlet because we can separate designing and
development. It provides some additional features such as Expression
Language, Custom Tags, etc.
There are many advantages of JSP over the Servlet. They are as follows:
1) Extension to Servlet
JSP technology is the extension to Servlet technology. We can use all the
features of the Servlet in JSP. In addition to, we can use implicit objects,
predefined tags, expression language and Custom tags in JSP, that makes
JSP development easy.
2) Easy to maintain
JSP can be easily managed because we can easily separate our business
logic with presentation logic. In Servlet technology, we mix our business
logic with the presentation logic.
In JSP, we can use many tags such as action tags, JSTL, custom tags, etc.
that reduces the code. Moreover, we can use EL, implicit objects, etc.
To create the first JSP page, write some HTML code as given below, and
save it by .jsp extension. We have saved this file as index. jsp. Put it in a
folder and paste the folder in the web-apps directory in apache tomcat to
run the JSP page.
index.jsp
Let's see the simple example of JSP where we are using the scriptlet tag to
put Java code in the JSP page. We will learn scriptlet tag later.
1. <html>
2. <body>
4. </body>
5. </html>
Servlet JSP
compilation code.
It does not have inbuilt implicit In JSP there are inbuilt implicit
objects. objects.
JSP Architecture
JSP architecture gives a high-level view of the working of JSP. JSP
architecture is a 3 tier architecture. It has a Client, Web Server, and
Database. The client is the web browser or application on the user side.
Web Server uses a JSP Engine i.e; a container that processes JSP. For
example, Apache Tomcat has a built-in JSP Engine. JSP Engine
intercepts the request for JSP and provides the runtime environment for
the understanding and processing of JSP files. It reads, parses, build
Java Servlet, Compiles and Executes Java code, and returns the HTML
page to the client. The webserver has access to the Database. The
following diagram shows the architecture of JSP.
Step 3: The JSP Engine loads the JSP file and translates the JSP to
Servlet(Java code). This is done by converting all the template text into
println() statements and JSP elements to Java code. This process is
called translation.
Step 6: The web server forwards the HTML file to the client’s browser.
o scriptlet tag
o expression tag
o declaration tag
1. <html>
2. <body>
4. </body>
5. </html>
File: index.html
1. <html>
2. <body>
3. <form action="welcome.jsp">
6. </form>
7. </body>
8. </html>
1. <html>
2. <body>
3. <%
4. String name=request.getParameter("uname");
5. out.print("welcome "+name);
6. %>
7. </form>
8. </body>
9. </html>
The code placed within JSP expression tag is written to the output
stream of the response. So you need not write out.print() to write data.
It is mainly used to print the values of variable or method.
1. <html>
2. <body>
4. </body>
5. </html>
index.jsp
1. <html>
2. <body>
4. </body>
5. </html>
In this example, we are printing the username using the expression tag.
The index.html file gets the username and sends the request to the
welcome.jsp file, which displays the username.
File: index.jsp
1. <html>
2. <body>
3. <form action="welcome.jsp">
6. </form>
7. </body>
8. </html>
File: welcome.jsp
1. <html>
2. <body>
4. </body>
5. </html>
The code written inside the jsp declaration tag is placed outside the
service() method of auto generated servlet.
In this example of JSP declaration tag, we are declaring the field and
printing the value of the declared field using the jsp expression tag.
index.jsp
1. <html>
2. <body>
5. </body>
6. </html>
In this example of JSP declaration tag, we are defining the method which
returns the cube of given number and calling this method from the jsp
expression tag. But we can also use jsp scriptlet tag to call the declared
method.
index.jsp
1. <html>
2. <body>
3. <%!
5. return n*n*n*;
6. }
7. %>
9. </body>
10. </html>
JSP Directives
A JSP directive affects the overall structure of the servlet class. It usually
has the following form −
<%@ directive attribute = "value" %>
Directives can have a number of attributes which you can list down as
key-value pairs and separated by commas.
The blanks between the @ symbol and the directive name, and between
the last attribute and the closing %>, are optional.
You can write the XML equivalent of the above syntax as follows −
Attributes
Following table lists out the attributes associated with the page directive
−
1 buffer
Specifies a buffering model for the output stream.
autoFlush
2
Controls the behavior of the servlet output buffer.
contentType
3
Defines the character encoding scheme.
errorPage
4 Defines the URL of another JSP that reports on Java unchecked
runtime exceptions.
isErrorPage
5 Indicates if this JSP page is a URL specified by another JSP
page's errorPage attribute.
extends
6
Specifies a superclass that the generated servlet must extend.
import
7 Specifies a list of packages or classes for use in the JSP as the
Java import statement does for Java classes.
info
8 Defines a string that can be accessed with the
servlet's getServletInfo() method.
isThreadSafe
9
Defines the threading model for the generated servlet.
language
10
Defines the programming language used in the JSP page.
11 session
Specifies whether or not the JSP page participates in HTTP
sessions
isELIgnored
12 Specifies whether or not the EL expression within the JSP page
will be ignored.
isScriptingEnabled
13
Determines if the scripting elements are allowed for use.
The filename in the include directive is actually a relative URL. If you just
specify a filename with no associated path, the JSP compiler assumes that
the file is in the same directory as your JSP.
You can write the XML equivalent of the above syntax as follows −
The JavaServer Pages API allow you to define custom JSP tags that look
like HTML or XML tags and a tag library is a set of user-defined tags that
implement custom behavior.
The taglib directive declares that your JSP page uses a set of custom
tags, identifies the location of the library, and provides means for
identifying the custom tags in your JSP page.
JSP - Actions
These actions use constructs in XML syntax to control the behavior of the
servlet engine. You can dynamically insert a file, reuse JavaBeans
components, forward the user to another page, or generate HTML for the
Java plugin.
There is only one syntax for the Action element, as it conforms to the XML
standard −
jsp:include
1
Includes a file at the time the page is requested.
jsp:useBean
2
Finds or instantiates a JavaBean.
jsp:setProperty
3
Sets the property of a JavaBean.
jsp:getProperty
4
Inserts the property of a JavaBean into the output.
jsp:forward
5
Forwards the requester to a new page.
jsp:plugin
6 Generates browser-specific code that makes an OBJECT or
EMBED tag for the Java plugin.
7 jsp:element
Defines XML elements dynamically.
jsp:attribute
8
Defines dynamically-defined XML element's attribute.
jsp:body
9
Defines dynamically-defined XML element's body.
jsp:text
10
Used to write template text in JSP pages and documents.
Common Attributes
There are two attributes that are common to all Action elements:
the idattribute and the scope attribute.
Id attribute
The id attribute uniquely identifies the Action element, and allows the
action to be referenced inside the JSP page. If the Action creates an
instance of an object, the id value can be used to reference it through the
implicit object PageContext.
Scope attribute
This attribute identifies the lifecycle of the Action element. The id attribute
and the scope attribute are directly related, as the scope attribute
determines the lifespan of the object associated with the id. The scope
attribute has four possible values: (a) page, (b)request, (c)session,
and (d) application.
This action lets you insert files into the page being generated. The syntax
looks like this −
Unlike the include directive, which inserts the file at the time the JSP
page is translated into a servlet, this action inserts the file at the time the
page is requested.
Following table lists out the attributes associated with the include action −
S.No. Attribute & Description
page
1
The relative URL of the page to be included.
flush
2 The boolean attribute determines whether the included
resource has its buffer flushed before it is included.
Example
Let us define the following two files (a)date.jsp and (b) main.jsp as
follows −
<html>
<head>
</head>
<body>
<center>
</center>
</body>
</html>
Let us now keep all these files in the root directory and try to
access main.jsp. You will receive the following output −
Following table lists out the attributes associated with the useBean action
−
class
1
Designates the full package name of the bean.
type
2
Specifies the type of the variable that will refer to the object.
beanName
3 Gives the name of the bean as specified by the instantiate ()
method of the java.beans.Beans class.
The setProperty action sets the properties of a Bean. The Bean must
have been previously defined before this action. There are two basic ways
to use the setProperty action −
...
...
</jsp:useBean>
name
1 Designates the bean the property of which will be set. The
Bean must have been previously defined.
property
value
param
The getProperty action has only two attributes, both of which are required.
The syntax of the getProperty action is as follows −
...
name
1 The name of the Bean that has a property to be retrieved. The
Bean must have been previously defined.
property
2 The property attribute is the name of the Bean property to be
retrieved.
Example
Let us define a test bean that will further be used in our example −
/* File: TestBean.java */
package action;
return(message);
this.message = message;
}
Compile the above code to the generated TestBean.class file and make
sure that you copied the TestBean.class in C:\apache-tomcat-7.0.2\
webapps\WEB-INF\classes\action folder and the CLASSPATH variable
should also be set to this folder −
Now use the following code in main.jsp file. This loads the bean and
sets/gets a simple String parameter −
<html>
<head>
</head>
<body>
<center>
<p>Got message....</p>
</center>
</body>
</html>
The forward action terminates the action of the current page and
forwards the request to another resource such as a static page, another
JSP page, or a Java Servlet.
Following table lists out the required attributes associated with the
forward action −
page
1 Should consist of a relative URL of another resource such as a
static page, another JSP page, or a Java Servlet.
Example
Let us reuse the following two files (a) date.jsp and (b) main.jsp as
follows −
<html>
<head>
</head>
<body>
<center>
</center>
</body>
</html>
Let us now keep all these files in the root directory and try to
access main.jsp. This would display result something like as below.
Here it discarded the content from the main page and displayed the
content from forwarded page only.
If the needed plugin is not present, it downloads the plugin and then
executes the Java component. The Java component can be either an
Applet or a JavaBean.
The plugin action has several attributes that correspond to common HTML
tags used to format Java components. The <param> element can also be
used to send parameters to the Applet or Bean.
<jsp:fallback>
</jsp:fallback>
</jsp:plugin>
Following table lists out the nine Implicit Objects that JSP supports −
1 request
This is the HttpServletRequest object associated with the
request.
response
2 This is the HttpServletResponse object associated with the
response to the client.
out
3
This is the PrintWriter object used to send output to the client.
session
4
This is the HttpSession object associated with the request.
application
5 This is the ServletContext object associated with the
application context.
config
6
This is the ServletConfig object associated with the page.
pageContext
7 This encapsulates use of server-specific features like higher
performance JspWriters.
page
8 This is simply a synonym for this, and is used to call the
methods defined by the translated servlet class.
Exception
9 The Exception object allows the exception data to be accessed
by designated JSP.
The response object also defines the interfaces that deal with creating
new HTTP headers. Through this object the JSP programmer can add new
cookies or date stamps, HTTP status codes, etc.
Following table lists out the important methods that we will use to
write boolean char, int, double, object, String, etc.
out.print(dataType dt)
1
Print a data type value
out.println(dataType dt)
2 Print a data type value then terminate the line with new line
character.
out.flush()
3
Flush the stream.
The session object is used to track client session between client requests
This object is a representation of the JSP page through its entire lifecycle.
This object is created when the JSP page is initialized and will be removed
when the JSP page is removed by the jspDestroy()method.
By adding an attribute to application, you can ensure that all JSP files that
make up your web application have access to it.
This object allows the JSP programmer access to the Servlet or JSP engine
initialization parameters such as the paths or file locations etc.
The following config method is the only one you might ever use, and its
usage is trivial −
config.getServletName();
This object stores references to the request and response objects for each
request. The application, config, session, and out objects are derived by
accessing attributes of this object.
pageContext.removeAttribute("attrName", PAGE_SCOPE);
The page object is really a direct synonym for the this object.
Simple Syntax
${expr}
value = "${2*box.width+2*box.height}"/>
You can also use the JSP EL expressions within template text for a
tag. For example, the <jsp:text> tag simply inserts its content
within the body of a JSP. The following <jsp:text> declaration
inserts <h1>Hello JSP!</h1> into the JSP output −
<jsp:text>
<h1>Hello JSP!</h1>
</jsp:text>
<jsp:text>
</jsp:text>
The valid values of this attribute are true and false. If it is true,
EL expressions are ignored when they appear in static text or tag
attributes. If it is false, EL expressions are evaluated by the
container.
Basic Operators in EL
.
1
Access a bean property or Map entry
[]
2
Access an array or List element
()
3
Group a subexpression to change the evaluation order
+
4
Addition
-
5
Subtraction or negation of a value
*
6
Multiplication
/ or div
7
Division
% or mod
8
Modulo (remainder)
== or eq
9
Test for equality
!= or ne
10
Test for inequality
< or lt
11
Test for less than
> or gt
12
Test for greater than
<= or le
13
Test for less than or equal
>= or ge
14
Test for greater than or equal
&& or and
15
Test for logical AND
|| or or
16
Test for logical OR
! or not
17
Unary Boolean complement
empty
18
Test for empty variable values
Explore our latest online courses and learn new skills at your own
pace. Enroll and become a certified expert to boost your career.
Functions in JSP EL
pageScope
1
Scoped variables from page scope
requestScope
2
Scoped variables from request scope
sessionScope
3
Scoped variables from session scope
applicationScope
4
Scoped variables from application scope
param
5
Request parameters as strings
paramValues
6
Request parameters as collections of strings
header
7
HTTP request headers as strings
headerValues
8
HTTP request headers as collections of strings
initParam
9
Context-initialization parameters
cookie
10
Cookie values
pageContext
11
The JSP PageContext object for the current page
To begin working with JSP tages you need to first install the JSTL
library. If you are using the Apache Tomcat container, then follow
these two steps −
Core Tags
Formatting tags
SQL tags
XML tags
JSTL Functions
Explore our latest online courses and learn new skills at your own
pace. Enroll and become a certified expert to boost your career.
Core Tags
The core group of tags are the most commonly used JSTL tags.
Following is the syntax to include the JSTL Core library in your JSP
−
<c:out>
1
Like <%= ... >, but for expressions.
<c:set >
2
Sets the result of an expression evaluation in a 'scope'
<c:remove >
3 Removes a scoped variable (from a particular scope, if
specified).
<c:catch>
4 Catches any Throwable that occurs in its body and
optionally exposes it.
5 <c:if>
Simple conditional tag which evalutes its body if the
supplied condition is true.
<c:choose>
<c:when>
7 Subtag of <choose> that includes its body if its
condition evalutes to 'true'.
<c:otherwise >
<c:import>
<c:forEach >
<c:forTokens>
11 Iterates over tokens, separated by the supplied
delimeters.
<c:param>
12
Adds a parameter to a containing 'import' tag's URL.
<c:redirect >
13
Redirects to a new URL.
<c:url>
14
Creates a URL with optional query parameters
Formatting Tags
The JSTL formatting tags are used to format and display text, the
date, the time, and numbers for internationalized Websites.
Following is the syntax to include Formatting library in your JSP −
<fmt:formatNumber>
1 To render numerical value with specific precision or
format.
<fmt:parseNumber>
2 Parses the string representation of a number, currency,
or percentage.
<fmt:formatDate>
3 Formats a date and/or time using the supplied styles
and pattern.
<fmt:parseDate>
4
Parses the string representation of a date and/or time
<fmt:bundle>
5
Loads a resource bundle to be used by its tag body.
<fmt:setLocale>
6 Stores the given locale in the locale configuration
variable.
<fmt:setBundle>
7 Loads a resource bundle and stores it in the named
scoped variable or the bundle configuration variable.
<fmt:timeZone>
8 Specifies the time zone for any time formatting or
parsing actions nested in its body.
<fmt:setTimeZone>
9 Stores the given time zone in the time zone
configuration variable
<fmt:message>
10
Displays an internationalized message.
<fmt:requestEncoding>
11
Sets the request character encoding
SQL Tags
The JSTL SQL tag library provides tags for interacting with
relational databases (RDBMSs) such as Oracle, mySQL,
or Microsoft SQL Server.
<sql:setDataSource>
1 Creates a simple DataSource suitable only for
prototyping
2 <sql:query>
<sql:update>
3 Executes the SQL update defined in its body or through
the sql attribute.
<sql:param>
4 Sets a parameter in an SQL statement to the specified
value.
<sql:dateParam>
5 Sets a parameter in an SQL statement to the specified
java.util.Date value.
<sql:transaction >
XML tags
The JSTL XML tag library has custom tags for interacting with the
XML data. This includes parsing the XML, transforming the XML
data, and the flow control based on the XPath expressions.
Before you proceed with the examples, you will need to copy the
following two XML and XPath related libraries into your <Tomcat
Installation Directory>\lib −
XercesImpl.jar − Download it
from https://www.apache.org/dist/xerces/j/
xalan.jar − Download it
from https://xml.apache.org/xalan-j/index.html
Following is the list of XML JSTL Tags −
<x:out>
1
Like <%= ... >, but for XPath expressions.
<x:parse>
2 Used to parse the XML data specified either via an
attribute or in the tag body.
<x:set >
3
Sets a variable to the value of an XPath expression.
<x:if >
<x:forEach>
5
To loop over nodes in an XML document.
<x:choose>
<x:when >
7 Subtag of <choose> that includes its body if its
expression evalutes to 'true'.
<x:otherwise >
9 <x:transform >
Applies an XSL transformation on a XML document
<x:param >
10 Used along with the transform tag to set a parameter
in the XSLT stylesheet
JSTL Functions
fn:contains()
1
Tests if an input string contains the specified substring.
fn:containsIgnoreCase()
2 Tests if an input string contains the specified substring
in a case insensitive way.
fn:endsWith()
3
Tests if an input string ends with the specified suffix.
fn:escapeXml()
4 Escapes characters that can be interpreted as XML
markup.
fn:indexOf()
5 Returns the index withing a string of the first
occurrence of a specified substring.
fn:join()
6
Joins all elements of an array into a string.
fn:length()
7 Returns the number of items in a collection, or the
number of characters in a string.
fn:replace()
8 Returns a string resulting from replacing in an input
string all occurrences with a given string.
fn:split()
9
Splits a string into an array of substrings.
fn:startsWith()
10
Tests if an input string starts with the specified prefix.
fn:substring()
11
Returns a subset of a string.
fn:substringAfter()
12 Returns a subset of a string following a specific
substring.
fn:substringBefore()
13
Returns a subset of a string before a specific substring.
fn:toLowerCase()
14
Converts all of the characters of a string to lower case.
fn:toUpperCase()
15
Converts all of the characters of a string to upper case.
16 fn:trim()
Removes white spaces from both ends of a string.
JSP tag extensions lets you create new tags that you can insert
directly into a JavaServer Page. The JSP 2.0 specification
introduced the Simple Tag Handlers for writing these custom
tags.
<ex:Hello />
To create a custom JSP tag, you must first create a Java class that
acts as a tag handler. Let us now create the HelloTag class as
follows −
package com.tutorialspoint;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
}
}
The above code has simple coding where the doTag() method
takes the current JspContext object using
the getJspContext() method and uses it to send "Hello Custom
Tag!" to the current JspWriter object
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<short-name>Example TLD</short-name>
<tag>
<name>Hello</name>
<tag-class>com.tutorialspoint.HelloTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
Let us now use the above defined custom tag Hello in our JSP
program as follows −
<html>
<head>
</head>
<body>
<ex:Hello/>
</body>
</html>
Call the above JSP and this should produce the following result −
You can include a message in the body of the tag as you have
seen with standard tags. Consider you want to define a custom
tag named <ex:Hello> and you want to use it in the following
fashion with a body −
<ex:Hello>
</ex:Hello>
package com.tutorialspoint;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
getJspBody().invoke(sw);
getJspContext().getOut().println(sw.toString());
}
Here, the output resulting from the invocation is first captured
into a StringWriter before being written to the JspWriter
associated with the tag. We need to change TLD file as follows −
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<tag>
<name>Hello</name>
<tag-class>com.tutorialspoint.HelloTag</tag-class>
<body-content>scriptless</body-content>
</tag>
</taglib>
Let us now call the above tag with proper body as follows −
<html>
<head>
</head>
<body>
<ex:Hello>
</ex:Hello>
</body>
</html>
You can use various attributes along with your custom tags. To
accept an attribute value, a custom tag class needs to implement
the settermethods, identical to the JavaBean setter methods as
shown below −
package com.tutorialspoint;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
this.message = msg;
if (message != null) {
out.println( message );
} else {
/* use message from the body */
getJspBody().invoke(sw);
getJspContext().getOut().println(sw.toString());
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<tag>
<name>Hello</name>
<tag-class>com.tutorialspoint.HelloTag</tag-class>
<body-content>scriptless</body-content>
<attribute>
<name>message</name>
</attribute>
</tag>
</taglib>
<html>
<head>
<title>A sample custom tag</title>
</head>
<body>
</body>
</html>
name
required
2 This specifies if this attribute is required or is an
optional one. It would be false for optional.
rtexprvalue
3 Declares if a runtime expression value for a tag
attribute is valid
type
4 Defines the Java class-type of this attribute. By default
it is assumed as String
description
5
Informational description can be provided.
6 fragment
Declares if this attribute value should be treated as
a JspFragment.
.....
<attribute>
<name>attribute_name</name>
<required>false</required>
<type>java.util.Date</type>
<fragment>false</fragment>
</attribute>
.....
If you are using two attributes, then you can modify your TLD as
follows −
.....
<attribute>
<name>attribute_name1</name>
<required>false</required>
<type>java.util.Boolean</type>
<fragment>false</fragment>
</attribute>
<attribute>
<name>attribute_name2</name>
<required>true</required>
<type>java.util.Date</type>
</attribute>
.....
Cookies
This may not be an effective way as the browser at times does not
support a cookie. It is not recommended to use this procedure to
maintain the sessions.
A web server can send a hidden HTML form field along with a
unique session ID as follows −
This entry means that, when the form is submitted, the specified
name and value are automatically included in the GET or
the POST data. Each time the web browser sends the request
back, the session_id value can be used to keep the track of
different web browsers.
URL Rewriting
You can append some extra data at the end of each URL. This
data identifies the session; the server can associate that session
identifier with the data it has stored about that session.
For example,
with http://tutorialspoint.com/file.htm;sessionid=12345, the
session identifier is attached as sessionid = 12345 which can be
accessed at the web server to identify the client.
URL rewriting is a better way to maintain sessions and works for
the browsers when they don't support cookies. The drawback
here is that you will have to generate every URL dynamically to
assign a session ID though page is a simple static HTML page.
Apart from the above mentioned options, JSP makes use of the
servlet provided HttpSession Interface. This interface provides a
way to identify a user across.
visit to a website or
The JSP engine exposes the HttpSession object to the JSP author
through the implicit session object. Since session object is
already provided to the JSP programmer, the programmer can
immediately begin storing and retrieving data from the object
without any initialization or getSession().
<%
if (session.isNew() ){
session.setAttribute(userIDKey, userID);
session.setAttribute(visitCountKey, visitCount);
}
visitCount = (Integer)session.getAttribute(visitCountKey);
visitCount = visitCount + 1;
userID = (String)session.getAttribute(userIDKey);
session.setAttribute(visitCountKey, visitCount);
%>
<html>
<head>
<title>Session Tracking</title>
</head>
<body>
<center>
<h1>Session Tracking</h1>
</center>
<th>Session info</th>
<th>Value</th>
</tr>
<tr>
<td>id</td>
</tr>
<tr>
<td>Creation Time</td>
<tr>
</tr>
<tr>
<td>User ID</td>
</tr>
<tr>
<td>Number of visits</td>
</tr>
</table>
</body>
</html>
Welcome to my website
Session Information
id 0AE3EC93FF44E3C525B4351B77ABB2D5
User ID ABCD
Number of visits 0
Now try to run the same JSP for the second time, you will receive
the following result.
Session Information
id 0AE3EC93FF44E3C525B4351B77ABB2D5
User ID ABCD
Number of visits 1
When you are done with a user's session data, you have several
options −
Delete the whole session − You can call the public void
invalidate() method to discard an entire session.
Log the user out − The servers that support servlets 2.4,
you can call logout to log the client out of the Web server
and invalidate all sessions belonging to all the users.
web.xml Configuration − If you are using Tomcat, apart from
the above mentioned methods, you can configure the
session time out in web.xml file as follows.
<session-config>
<session-timeout>15</session-timeout>
</session-config>