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
Explain about the process of functioning of the struts program?
What are the various struts tag libraries?
Difference between html tags and struts specific html tags
How can we display all validation errors to user on jsp page?
What are the reasons for an error message not being displayed while developing struts application?
What is struts and why it is used?
What is struts xml?
How interceptor works in struts 2?
Why actionservlet is singleton in struts?
What are the applications of struts?
What is life cycle of an interceptor?
What is struts framework?
Can you explain struts validator framework?
What is used to display the intermediate result in an interceptor?
What are construction struts?