What is the difference between pageContext and page
implicit objects in jsp?
Answers were Sorted based on User's Feedback
Answer / ravikiran(aptech mumbai)
pagecontext is used to include or forward to another resource,
PageContext is used to save the scoped objects
PageContext is used to hold the page scoped attributes
where as page is the instance of the generated servlet
Is This Answer Correct ? | 36 Yes | 1 No |
Answer / venkat
pageContext is used to get different scope objects like
request,session,context etc. where as page object of jsp is
used to refer the current page scope and can be compared
with local variable declared.
Is This Answer Correct ? | 21 Yes | 4 No |
PageContext: This is used to access page attributes and
also to access all the namespaces associated with a JSP
page. It provides a single API to manage the various scoped
attributes.
PageContext also provides access to several page attributes
like including some static or dynamic resource.
The object PageContext is written:
Javax.servlet.jsp.pagecontext
Page: The Page object denotes the JSP page, used for calling
any instance of a Page's servlet. It has page scope. First
type cast the servlet before accessing any method of the
servlet through the page.
The Page object is written: Java.lang.Object
Is This Answer Correct ? | 14 Yes | 1 No |
Answer / kaushal rajput
9 types of Implicit Object are there in jsp technology they are:-
(1)Page
(2)pageContext
(3)application
(4)session
(5)exception
(6)config
(7)request
(8)responce
(9)out
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / amit
Page and Pagecontext are implicit objects in jsp. These are created at JSP translated time. The page object represents the generated servlet instance itself and is used as a scope with in one jsp. Pagecontext is used to initilize all implicit objects for example :- page attributes, access to the request, response and session objects, as well as the JspWriter referenced by out. Refer http://modernpathshala.com/Learn/servlet-and-jsp/Interview to read servlet and jsp interview questions
Is This Answer Correct ? | 1 Yes | 0 No |
Hi Ravikiran
Thanks for your quick response .
Thanks & Regards
Vinodh.
Is This Answer Correct ? | 1 Yes | 2 No |
Hi shailendra
Thnks for your response, but iam asking what is the
difference between page and pagecontext implicit objects in
jsp?
Thanks & Regards
Vinod
Is This Answer Correct ? | 1 Yes | 6 No |
Answer / anil das
page context is the apllication object,that can be used for
entire aplication. and page config object is for one
servlet generated object.
Is This Answer Correct ? | 6 Yes | 20 No |
Page Implicit Object :
8 type of Implicit object are genreted when JSP file is
converted into Servlet
8 type of Implicit Object are
(1)Page
(2)pageContext
(3)application
(4)session
(5)exception
(6)config
(7)request
(8)responce
pagecontext is type of implicit Object
in pageContext two method is available
(1)include
(2)forward
it is equvaalect in servlet to RequestDispatcher
Is This Answer Correct ? | 5 Yes | 27 No |
In the below example, what will be the output?
What do you mean by stack?
What are the six ways to use this keyword?
What is the difference between an interface and an abstract class?
What are library required to connect to excel sheet.
Is string is a data type in java?
How many bytes are a float?
Is there any use of an abstract class which has no methods and no attributes?
What is the difference between sop and work instruction?
What is a method declaration?
Can we declare a class as static?
What is a memory leak in java?