what is the difference between page and pageContext
implicit variables

Answers were Sorted based on User's Feedback



what is the difference between page and pageContext implicit variables..

Answer / guest

The implicit variable page is of class java.lang.Object and
it refers to instance of generated servlet. It is declared as
Object page=this
Consider
<%= page.getServletInfo() %> will give Error
getServletInfo() is not a method of java.lang.Object
<%= ((Servlet)page).getServletInfo() %> is valid

pageContext variable is of type
javax.servlet.jsp.PageContext. The PageContext class is the
abstract class and JSP engine vendor provides its concrete
subclass.
·Store reference to implicit objects,
·Provide method to get and set attributes in different scopes.
·Provide convenience methods for transferring request to
other resources in web application.
PageContext.forward(“other.jsp”);

Is This Answer Correct ?    12 Yes 1 No

what is the difference between page and pageContext implicit variables..

Answer / rajesh rakam

Page:
The implicit variable page is of class java.lang.Object and
it refers to instance of generated servlet. It is declared as
Object page=this
<%= ((Servlet)page).getServletInfo() %> is valid

pageContext:
pageContext variable is of type
javax.servlet.jsp.PageContext. The PageContext class is the
abstract class and JSP engine vendor provides its concrete
subclass.
->Store reference to implicit objects,
->Provide method to get and set attributes in different scopes.
->Provide convenience methods for transferring request to
other resources in web application.
PageContext.forward(&#65533;other.jsp&#65533;);

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Struts Interview Questions

multiple instances for action class is it possible

8 Answers   iFlex, ProSoft,


What are best practices to follow while developing Struts2 application?

0 Answers  


Explain about logic match tag?

0 Answers  


What is apache struts cve 2017 5638?

0 Answers  


How is the Struts framworl related to MVC2?

2 Answers   Wipro,






What are the pros of struts 2?

0 Answers  


how to debug struts project in netbean ?

0 Answers  


What is struts and springs in java?

0 Answers  


What does apache struts do?

0 Answers  


why we use struts in our web application , means what was drawbacks of servlet ...pls answer

1 Answers   IBM,


What are the components of struts?

0 Answers  


What are the loop holes of struts?

0 Answers  


Categories