what is the difference between page and pageContext
implicit variables
Answer Posted / 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 |
Post New Answer View All Answers
How can we integrate log4j in Struts2 application?
What is the struts in java?
What is the difference between struts1 and struts2?
how to develop the submit and search operations in single jsp using struts?
What does action do in struts?
Difference between struts and spring? Or why use spring, if you are already using struts?
How properties of a form are validated in Struts?
What is Struts2?
Explain how to work with error tags?
what is ACID test for fresh engineers??what is the pattern??
Explain struts?
What is struts 2 framework in java?
What is the purpose of @before annotation?
What are interceptors in struts 2?
What is the difference between empty default namespace and root namespace?