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 |
Suppose there is an Online shopping cart application having different objects like Cart, SelectionItem, Billing, COnfiguration, Authentication, Authorization, PersonalDetails etc. Out of this which one can be made a singleton pattern and why?
What is the difference between a loader and a compiler?
Tell us something about set interface.
Write code of any action class?
What about main() method in java ?
If you are reviewing the code of your team members, what points will you look at, assuming the performance of the application is not so great
Where local and global variables are stored?
What is the purpose of premetive data types in java?
Java support what type of parameter passing ?
how to create an applet
Which class represents the socket that both the client and server use to communicate with each other?
What is Java Package and which package is imported by default?