0% found this document useful (0 votes)
3 views

web b-2 ch-2

Hh

Uploaded by

ag298744
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

web b-2 ch-2

Hh

Uploaded by

ag298744
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Sumaya academy

G61 near walia nursing home opposite metro pillar 40


Laxminagar delhi-92
8826767298,8826764330

JSP technology is used to create web application just like Servlet technology. It can be
thought of as an extension to Servlet because it provides more functionality than
servlet such as expression language, JSTL, etc.

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.

Advantages of JSP over Servlet


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.

3) Fast Development: No need to recompile and redeploy

If JSP page is modified, we don't need to recompile and redeploy the project. The
Servlet code needs to be updated and recompiled if we have to change the look and
feel of the application.

4) Less code than Servlet

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.

The Lifecycle of a JSP Page


The JSP pages follow these phases:

o Translation of JSP Page


o Compilation of JSP Page
o Classloading (the classloader loads class file)
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

o Instantiation (Object of the Generated Servlet is created).


o Initialization ( the container invokes jspInit() method).
o Request processing ( the container invokes _jspService() method).
o Destroy ( the container invokes jspDestroy() method).

Note: jspInit(), _jspService() and jspDestroy() are the life cycle methods of JSP.

As depicted in the above diagram, JSP page is translated into Servlet by the help of
JSP translator. The JSP translator is a part of the web server which is responsible for
translating the JSP page into Servlet. After that, Servlet page is compiled by the
compiler and gets converted into the class file. Moreover, all the processes that happen
in Servlet are performed on JSP later like initialization, committing response to the
browser and destroy.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Creating a simple JSP Page


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>
3. <% out.print(2*5); %>
4. </body>
5. </html>

It will print 10 on the browser.

How to run a simple JSP Page?


Follow the following steps to execute this JSP page:

o Start the server


o Put the JSP file in a folder and deploy on the server
o Visit the browser by the URL http://localhost:portno/contextRoot/jspfile, for example,
http://localhost:8888/myapplication/index.jsp

Do I need to follow the directory structure to run a simple


JSP?
No, there is no need of directory structure if you don't have class files or TLD files. For
example, put JSP files in a folder directly and deploy that folder. It will be running fine.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

However, if you are using Bean class, Servlet or TLD file, the directory structure is
required.

The Directory structure of JSP


The directory structure of JSP page is same as Servlet. We contain the JSP page outside
the WEB-INF folder or in any directory.

JSP directives
The jsp directives are messages that tells the web container how to translate a JSP
page into the corresponding servlet.

There are three types of directives:

o page directive
o include directive
o taglib directive

Syntax of JSP Directive


1. <%@ directive attribute="value" %>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

JSP page directive


The page directive defines attributes that apply to an entire JSP page.

Syntax of JSP page directive


1. <%@ page attribute="value" %>
Attributes of JSP page directive
o import
o contentType
o extends
o info
o buffer
o language
o isELIgnored
o isThreadSafe
o autoFlush
o session
o pageEncoding
o errorPage
o isErrorPage

1)import
The import attribute is used to import class,interface or all the members of a package.It is similar to import k

Example of import attribute


1. <html>
2. <body>
3.
4. <%@ page import="java.util.Date" %>
5. Today is: <%= new Date() %>
6.
7. </body>
8. </html>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

2)contentType
The contentType attribute defines the MIME(Multipurpose Internet Mail Extension)
type of the HTTP response.The default value is "text/html;charset=ISO-8859-1".

64M

1.3K

Features of Java - Javatpoint

Example of contentType attribute


1. <html>
2. <body>
3.
4. <%@ page contentType=application/msword %>
5. Today is: <%= new java.util.Date() %>
6.
7. </body>
8. </html>

3)extends
The extends attribute defines the parent class that will be inherited by the generated
servlet.It is rarely used.

4)info
This attribute simply sets the information of the JSP page which is retrieved later by
using getServletInfo() method of Servlet interface.

Example of info attribute


1. <html>
2. <body>
3.
4. <%@ page info="composed by Sonoo Jaiswal" %>
5. Today is: <%= new java.util.Date() %>
6.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

7. </body>
8. </html>

The web container will create a method getServletInfo() in the resulting servlet.For
example:

1. public String getServletInfo() {


2. return "composed by Sonoo Jaiswal";
3. }

5)buffer
The buffer attribute sets the buffer size in kilobytes to handle output generated by the
JSP page.The default size of the buffer is 8Kb.

Example of buffer attribute


1. <html>
2. <body>
3.
4. <%@ page buffer="16kb" %>
5. Today is: <%= new java.util.Date() %>
6.
7. </body>
8. </html>

6)language
The language attribute specifies the scripting language used in the JSP page. The
default value is "java".

7)isELIgnored
We can ignore the Expression Language (EL) in jsp by the isELIgnored attribute. By default its value is false i.
default. We see Expression Language later.

1. <%@ page isELIgnored="true" %>//Now EL will be ignored


Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

8)isThreadSafe
Servlet and JSP both are multithreaded.If you want to control this behaviour of JSP page, you can use isThre
value of isThreadSafe value is true.If you make it false, the web container will serialize the multiple request
responding to a request before passing another request to it.If you make the value of isThreadSafe attribute

<%@ page isThreadSafe="false" %>

The web container in such a case, will generate the servlet as:

1. public class SimplePage_jsp extends HttpJspBase


2. implements SingleThreadModel{
3. .......
4. }

9)errorPage
The errorPage attribute is used to define the error page, if exception occurs in the
current page, it will be redirected to the error page.

Example of errorPage attribute


1. //index.jsp
2. <html>
3. <body>
4.
5. <%@ page errorPage="myerrorpage.jsp" %>
6.
7. <%= 100/0 %>
8.
9. </body>
10. </html>

10)isErrorPage
The isErrorPage attribute is used to declare that the current page is the error page.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Note: The exception object can only be used in the error page.
Example of isErrorPage attribute
1. //myerrorpage.jsp
2. <html>
3. <body>
4.
5. <%@ page isErrorPage="true" %>
6.
7. Sorry an exception occured!<br/>
8. The exception is: <%= exception %>
9.
10. </body>
11. </html>

Jsp Include Directive


The include directive is used to include the contents of any resource it may be jsp file,
html file or text file. The include directive includes the original content of the included
resource at page translation time (the jsp page is translated only once so it will be
better to include static resource).

Advantage of Include directive


Code Reusability

Syntax of include directive


1. <%@ include file="resourceName" %>
Example of include directive
In this example, we are including the content of the header.html file. To run this
example you must create an header.html file.

1. <html>
2. <body>
3.
4. <%@ include file="header.html" %>
5.
6. Today is: <%= java.util.Calendar.getInstance().getTime() %>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

7.
8. </body>
9. </html>

JSP Taglib directive


The JSP taglib directive is used to define a tag library that defines many tags. We use
the TLD (Tag Library Descriptor) file to define the tags. In the custom tag section we
will use this tag so it will be better to learn it in custom tag.

Syntax JSP Taglib directive


1. <%@ taglib uri="uriofthetaglibrary" prefix="prefixoftaglibrary" %>

Example of JSP Taglib directive


In this example, we are using our tag named currentDate. To use this tag we must
specify the taglib directive so the container may get information about the tag.

1. <html>
2. <body>
3.
4. <%@ taglib uri="http://www.javatpoint.com/tags" prefix="mytag" %>
5.
6. <mytag:currentDate/>
7.
8. </body>
9. </html>

jsp:useBean action tag


1. jsp:useBean action tag
2. Syntax of jsp:useBean action tag
3. Attributes and Usage of jsp:useBean action tag
4. Simple example of jsp:useBean action tag

The jsp:useBean action tag is used to locate or instantiate a bean class. If bean object
of the Bean class is already created, it doesn't create the bean depending on the scope.
But if object of bean is not created, it instantiates the bean.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Syntax of jsp:useBean action tag

1. <jsp:useBean id= "instanceName" scope= "page | request | session | applicatio


n"
2. class= "packageName.className" type= "packageName.className"
3. beanName="packageName.className | <%= expression >" >
4. </jsp:useBean>
Attributes and Usage of jsp:useBean action tag
1. id: is used to identify the bean in the specified scope.
2. scope: represents the scope of the bean. It may be page, request, session or
application. The default scope is page.
o page: specifies that you can use this bean within the JSP page. The default
scope is page.
o request: specifies that you can use this bean from any JSP page that processes
the same request. It has wider scope than page.
o session: specifies that you can use this bean from any JSP page in the same
session whether processes the same request or not. It has wider scope than
request.
o application: specifies that you can use this bean from any JSP page in the same
application. It has wider scope than session.
3. class: instantiates the specified bean class (i.e. creates an object of the bean class) but
it must have no-arg or no constructor and must not be abstract.
4. type: provides the bean a data type if the bean already exists in the scope. It is mainly
used with class or beanName attribute. If you use it without class or beanName, no
bean is instantiated.
5. beanName: instantiates the bean using the java.beans.Beans.instantiate() method.

Simple example of jsp:useBean action tag


In this example, we are simply invoking the method of the Bean class.

For the example of setProperty, getProperty and useBean tags, visit next page.
Calculator.java (a simple Bean class)
1. package com.javatpoint;
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

2. public class Calculator{


3.
4. public int cube(int n){return n*n*n;}
5.
6. }
index.jsp file
1. <jsp:useBean id="obj" class="com.javatpoint.Calculator"/>
2.
3. <%
4. int m=obj.cube(5);
5. out.print("cube of 5 is "+m);
6. %>

jsp:setProperty and jsp:getProperty action


tags
The setProperty and getProperty action tags are used for developing web application
with Java Bean. In web devlopment, bean class is mostly used because it is a reusable
software component that represents data.

The jsp:setProperty action tag sets a property value or values in a bean using the setter
method.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Syntax of jsp:setProperty action tag

1. <jsp:setProperty name="instanceOfBean" property= "*" |


2. property="propertyName" param="parameterName" |
3. property="propertyName" value="{ string | <%= expression %>}"
4. />

Example of jsp:setProperty action tag if you have to set all the values of
incoming request in the bean
1. <jsp:setProperty name="bean" property="*" />

Example of jsp:setProperty action tag if you have to set value of the


incoming specific property
1. <jsp:setProperty name="bean" property="username" />

Example of jsp:setProperty action tag if you have to set a specific value


in the property
1. <jsp:setProperty name="bean" property="username" value="Kumar" />

jsp:getProperty action tag


The jsp:getProperty action tag returns the value of the property.

Syntax of jsp:getProperty action tag


1. <jsp:getProperty name="instanceOfBean" property="propertyName" />

Simple example of jsp:getProperty action tag


1. <jsp:getProperty name="obj" property="name" />

Example of bean development in JSP


In this example there are 3 pages:
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Play Videox

o index.html for input of values


o welocme.jsp file that sets the incoming values to the bean object and prints the one
value
o User.java bean class that have setter and getter methods

index.html
1. <form action="process.jsp" method="post">
2. Name:<input type="text" name="name"><br>
3. Password:<input type="password" name="password"><br>
4. Email:<input type="text" name="email"><br>
5. <input type="submit" value="register">
6. </form>
process.jsp
1. <jsp:useBean id="u" class="org.sssit.User"></jsp:useBean>
2. <jsp:setProperty property="*" name="u"/>
3.
4. Record:<br>
5. <jsp:getProperty property="name" name="u"/><br>
6. <jsp:getProperty property="password" name="u"/><br>
7. <jsp:getProperty property="email" name="u" /><br>
User.java
1. package org.sssit;
2.
3. public class User {
4. private String name,password,email;
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

5. //setters and getters


6. }
download this example

Reusing Bean in Multiple Jsp Pages


Let's see the simple example, that prints the data of bean object in two jsp pages.

index.jsp

Same as above.

User.java

Same as above.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

process.jsp
1. <jsp:useBean id="u" class="org.sssit.User" scope="session"></jsp:useBean>
2. <jsp:setProperty property="*" name="u"/>
3.
4. Record:<br>
5. <jsp:getProperty property="name" name="u"/><br>
6. <jsp:getProperty property="password" name="u"/><br>
7. <jsp:getProperty property="email" name="u" /><br>
8.
9. <a href="second.jsp">Visit Page</a>

second.jsp
1. <jsp:useBean id="u" class="org.sssit.User" scope="session"></jsp:useBean>
2. Record:<br>
3. <jsp:getProperty property="name" name="u"/><br>
4. <jsp:getProperty property="password" name="u"/><br>
5. <jsp:getProperty property="email" name="u" /><br>
Using variable value in setProperty tag
In some case, you may get some value from the database, that is to be set in the bean
object, in such case, you need to use expression tag. For example:

process.jsp
1. <jsp:useBean id="u" class="org.sssit.User"></jsp:useBean>
2. <%
3. String name="arjun";
4. %>
5. <jsp:setProperty property="name" name="u" value="<%=name %>"/>
6.
7. Record:<br>
8. <jsp:getProperty property="name" name="u"/><br>

JSP Action Tags


There are many JSP action tags or elements. Each JSP action tag is used to perform
some specific tasks.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Syntax of jsp:forward action tag without parameter


1. <jsp:forward page="relativeURL | <%= expression %>" />
Syntax of jsp:forward action tag with parameter
1. <jsp:forward page="relativeURL | <%= expression %>">
2. <jsp:param name="parametername" value="parametervalue | <%=expression%>" />

3. </jsp:forward>

Example of jsp:forward action tag without parameter


In this example, we are simply forwarding the request to the printdate.jsp file.

index.jsp
1. <html>
2. <body>
3. <h2>this is index page</h2>
4.
5. <jsp:forward page="printdate.jsp" />
6. </body>
7. </html>
printdate.jsp
1. <html>
2. <body>
3. <% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>
4. </body>
5. </html>
download this example

Example of jsp:forward action tag with parameter


In this example, we are forwarding the request to the printdate.jsp file with parameter
and printdate.jsp file prints the parameter value with date and time.

index.jsp
1. <html>
2. <body>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

3. <h2>this is index page</h2>


4.
5. <jsp:forward page="printdate.jsp" >
6. <jsp:param name="name" value="javatpoint.com" />
7. </jsp:forward>
8.
9. </body>
10. </html>
printdate.jsp
1. <html>
2. <body>
3.
4. <% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>
5. <%= request.getParameter("name") %>
6.
7. </body>
8. </html>

jsp:include action tag


The jsp:include action tag is used to include the content of another resource it may
be jsp, html or servlet.

The jsp include action tag includes the resource at request time so it is better for
dynamic pages because there might be changes in future.

The jsp:include tag can be used to include static as well as dynamic pages.

Syntax of jsp:include action tag without parameter


1. <jsp:include page="relativeURL | <%= expression %>" />
Syntax of jsp:include action tag with parameter
1. <jsp:include page="relativeURL | <%= expression %>">
2. <jsp:param name="parametername" value="parametervalue | <%=expression%>" />

3. </jsp:include>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Example of jsp:include action tag without parameter


In this example, index.jsp file includes the content of the printdate.jsp file.

File: index.jsp

1. <h2>this is index page</h2>


2.
3. <jsp:include page="printdate.jsp" />
4.
5. <h2>end section of index page</h2>
File: printdate.jsp

1. <% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>

JSP request implicit object


The JSP request is an implicit object of type HttpServletRequest i.e. created for each
jsp request by the web container. It can be used to get request information such as
parameter, header information, remote address, server name, server port, content
type, character encoding etc.

It can also be used to set, get and remove attributes from the jsp request scope.

Let's see the simple example of request implicit object where we are printing the name
of the user with welcome message.
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Example of JSP request implicit object


index.html
1. <form action="welcome.jsp">
2. <input type="text" name="uname">
3. <input type="submit" value="go"><br/>
4. </form>
welcome.jsp
1. <%
2. String name=request.getParameter("uname");
3. out.print("welcome "+name);
4. %>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Output

JSP response
implicit object
In JSP, response is an implicit object of type HttpServletResponse. The instance of
HttpServletResponse is created by the web container for each jsp request.

It can be used to add or manipulate response such as redirect response to another


resource, send error etc.

Let's see the example of response implicit object where we are redirecting the response
to the Google.

Example of response implicit object


index.html
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

1. <form action="welcome.jsp">
2. <input type="text" name="uname">
3. <input type="submit" value="go"><br/>
4. </form>
welcome.jsp

1. <%
2. response.sendRedirect("http://www.google.com");
3. %>
Output

session implicit object


In JSP, session is an implicit object of type HttpSession.The Java developer can use this object to set,get
information.

Example of session implicit object


index.html
1. <html>
2. <body>
3. <form action="welcome.jsp">
4. <input type="text" name="uname">
5. <input type="submit" value="go"><br/>
6. </form>
7. </body>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

8. </html>
welcome.jsp
1. <html>
2. <body>
3. <%
4.
5. String name=request.getParameter("uname");
6. out.print("Welcome "+name);
7.
8. session.setAttribute("user",name);
9.
10. <a href="second.jsp">second jsp page</a>
11.
12. %>
13. </body>
14. </html>
second.jsp
1. <html>
2. <body>
3. <%
4.
5. String name=(String)session.getAttribute("user");
6. out.print("Hello "+name);
7.
8. %>
9. </body>
10. </html>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Output
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

JSP application implicit object


In JSP, application is an implicit object of type ServletContext.

The instance of ServletContext is created only once by the web container when
application or project is deployed on the server.

This object can be used to get initialization parameter from configuaration file
(web.xml). It can also be used to get, set or remove attribute from the application
scope.

This initialization parameter can be used by all jsp pages.

Example of application implicit object:


index.html

1. <form action="welcome">
2. <input type="text" name="uname">
3. <input type="submit" value="go"><br/>
4. </form>
web.xml file

1. <web-app>
2.
3. <servlet>
4. <servlet-name>sonoojaiswal</servlet-name>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

5. <jsp-file>/welcome.jsp</jsp-file>
6. </servlet>
7.
8. <servlet-mapping>
9. <servlet-name>sonoojaiswal</servlet-name>
10. <url-pattern>/welcome</url-pattern>
11. </servlet-mapping>
12.
13. <context-param>
14. <param-name>dname</param-name>
15. <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
16. </context-param>
17.
18. </web-app>
welcome.jsp

1. <%
2.
3. out.print("Welcome "+request.getParameter("uname"));
4.
5. String driver=application.getInitParameter("dname");
6. out.print("driver name is="+driver);
7.
8. %>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Output

pageContext implicit object


In JSP, pageContext is an implicit object of type PageContext class.The pageContext object can be used to se
the following scopes:

o page
o request
o session
o application

In JSP, page scope is the default scope.


Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Example of pageContext implicit object


index.html
1. <html>
2. <body>
3. <form action="welcome.jsp">
4. <input type="text" name="uname">
5. <input type="submit" value="go"><br/>
6. </form>
7. </body>
8. </html>
welcome.jsp
1. <html>
2. <body>
3. <%
4.
5. String name=request.getParameter("uname");
6. out.print("Welcome "+name);
7.
8. pageContext.setAttribute("user",name,PageContext.SESSION_SCOPE);
9.
10. <a href="second.jsp">second jsp page</a>
11.
12. %>
13. </body>
14. </html>
second.jsp
1. <html>
2. <body>
3. <%
4.
5. String name=(String)pageContext.getAttribute("user",PageContext.SESSION_S
COPE);
6. out.print("Hello "+name);
7.
8. %>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

9. </body>
10. </html>
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

Output
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330
Sumaya academy
G61 near walia nursing home opposite metro pillar 40
Laxminagar delhi-92
8826767298,8826764330

page implicit object:


In JSP, page is an implicit object of type Object class.This object is assigned to the reference of auto generat

Object page=this;

For using this object it must be cast to Servlet type.For example:

<% (HttpServlet)page.log("message"); %>

Since, it is of type Object it is less used because you can use this object directly in jsp.For example:

<% this.log("message"); %>

You might also like