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 |
byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p?
Can you change array size in java?
What are java annotations?
What is the method in java?
What is the blank final variable?
Can we override constructor?
how can i take the inputs from users in java program?
Default layout of Dialog object?
What are the changes in java.io in java 8 ?
What are the new features in java 8? Explain
Is finalize() similar to a destructor?
What is a numeric format?