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
Explain jsp and tell its uses?
What is jsp action tags?
What is the jsp:plugin action ?
What is difference between custom jsp tags and beans?
Why jsp is used instead of html?
What is meant by jsp?
How many tags are there in jsp?
Explain the difference between jspwriter and servlet printwriter in jsp?
Can you call jsp from servlet?
How many messaging models do jms provide for and what are they?
What are scriptlets in jsp?
What is jsp and asp?
What is jstl used for?
Why does jcomponent have add() and remove() methods but the component does not?
Give an example where you need jsp custom tag?