Scope of JSP Objects
Last modified on July 25th, 2014 by Joe.
The availability of a JSP object for use from a particular place of the application is defined as the scope of that JSP object. Every object created in a JSP page will have a scope. Object scope in JSP is segregated into four parts and they are page, request, session and application.
- page
‘page’ scope means, the JSP object can be accessed only from within the same page where it was created. The default scope for JSP objects created using <jsp:useBean> tag is page. JSP implicit objects out, exception, response, pageContext, config and page have ‘page’ scope.
- request
A JSP object created using the ‘request’ scope can be accessed from any pages that serves that request. More than one page can serve a single request. The JSP object will be bound to the request object. Implicit object request has the ‘request’ scope.
- session
‘session’ scope means, the JSP object is accessible from pages that belong to the same session from where it was created. The JSP object that is created using the session scope is bound to the session object. Implicit object session has the ‘session’ scope.
- application
A JSP object created using the ‘application’ scope can be accessed from any pages across the application. The JSP object is bound to the application object. Implicit object application has the ‘application’ scope.
Hi,Your explanation about scope of jsp objects is very good.It is very helpful to me.I found the clear information about the jsp objects scope.
Thanks….Keep Posting similar articles.
expalain in detail
Excellent!
Your explanation about the JSP scope objects is really good.
But if i’m not going to use <jsp:useBean tag in the form then what will be scope of the jsp page.Is it page or else any other scope from the remaining.
its true…………..
jsp:tags in detail??????/
thank for good explanation;
shohag
very nice explanation…
thank you Joe
exellent explanation….
its really a useful article…
thnks..
exellent explanation….
it is not a good example……
Hi,
Scope of JSP Objects are
1.request
2.responce
3.application
4.session
5.out
6.config
7.pagecontet
8.page
9.exception
Hi,
I read your article easy to understand for freshers and usefulll…
do the needful thro out your life
Hi SHOWNISHA,
The list you had given above are JSP implicit objects. You are mistaken that with the scope of JSP object.
Stellar work there eveoynre. I’ll keep on reading.
TO Shownisha: Hi, 9 objects which you had listed out were not scope of the JSP objects, they are implicit objects. What joe mentioned those 4 are scopes
thanks,
could u pls send example for each scope objects in jsp
good one.
I LIKE JAVA VERY VERY MUCH,I ALSO JAVA SE 6 CERTIFIED PROFESSIONAL(OCJP 6). GIVE NEXT STEP FOR MY BRIGHT FUTURE…
good
please send me the java books which is useful
not too satisfying…add life to it with a few examples…layout is nice.
please provide the examples for each,it will be easy to understand the new people
hi I want scopesof jsp with examples
thanku
thanku sir ji
How container differentiate between servlet and jsp………?
Your notes are really very easy to understand.
hello Joe,
Very nice and simple explanation of everything. I understood the scope of jsp objects but still can you give me live example for these scope? So it will help me more to remember.
Thank you.
good tutorial
Hi joe,
Please provide How will we handle the error code like 500 internal server error in application level ?
Thanks in advance.
Simple and clear
Thanks a lot
These are implicit objects
Thank u very much for sharing information. …
its really very gud for understanding thank u very much for sharing info
Very nice explanation if have an example it will be beter than now. thanaks
clearly understood.
good
Thanks….example needed