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

What is struts framework in java?

0 Answers  


Explain about the validation steps which have to be carried during validation of client-side address?

0 Answers  


What is ognl?

0 Answers  


What is pojo in struts2?

0 Answers  


What is the difference between requestaware and servletrequestaware interface?

0 Answers  






How can forward action be used to restrict a strut application to mvc?

0 Answers  


What do you know about validation plugin ?

0 Answers  


List some bundled validators?

0 Answers  


Is it possible to create mulitple instance of one Action Class in struts?

10 Answers   Satyam,


What is Request Dispatcher and What is reuest Processor??

2 Answers  


Briefly tell the two kinds of form beans.

0 Answers  


I facing problems while explaining project details in the interview...... can any tell complete project architecture that followed in companies

1 Answers   ID,


Categories