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

Give an example where struts tiles may be used?

0 Answers  


what are the disadvantages of MVC architecture

3 Answers   INDUS,


What is the purpose of @conversion annotation annotation?

0 Answers  


Explain about tiles?

0 Answers  


What are the action classes in struts?

0 Answers  


What is the use of reset method of ActionForm class?

0 Answers  


What is the differnce between 2-tier architecture and 3- tier architecture in java?

3 Answers  


What is the purpose of plug-in tag in struct-config.xml?

0 Answers  


what is the current salary package in India for a java programmer who has 2 years experience

7 Answers  


what is project architecture?give brief explanation about project architecture?

3 Answers   CTS, Etisalat, IBM, Infinite Computer Solutions, Mphasis,


What is the purpose of form-beans tag in struct-config.xml?

0 Answers  


What is discontinuous strut?

0 Answers  


Categories