Are application, pageContext and object of ServletContext
same or not?
Answer Posted / farhaananwar
application and object of ServletContext are same. In jsp
page application implicit variable represents object of
ServletContext but pageContext represent object whose super
class is SerlvetContext. the class of PageContext has some
conviniant methods for manipulation of attributes of
different scopes. These methods are findAttribute, get/set/
removeAttribute that accept last parameter as a int value
representing scope to which attribute pass to methods
belongs.
The PageContext has integral contant value for showing
scopes which are PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE
and APPLICATION_SCOPE. These constant values are used as a
last arguement to set/get/removeAttribute methods to
indicate to which scope the attribute belong. such a methods
and consant values are not present in its super class
ServletContext.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are jsp declarations?
How do I view jsp files in my browser?
Mention the various implicit objects used in the expression
How many tags are provided by jstl?
How to include static files in a JSP page?
How to call java method in jsp page on button click?
What is difference between sendredirect and forward?
Tell us about the stages (phases) of the jsp life cycle.
Define scriptlet, expression and declaration in jsp?
What are the implicit, internal objects and methods on the jsp page?
What is the jsp:getproperty action?
How we can use javascript with jsp pages?
Which implicit object is not available in normal jsp pages?
How can we use beans in jsp?
What is jsp in javascript?