File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes scopes in the jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "scopes in the jsp" Watch "scopes in the jsp" New topic

scopes in the jsp

ajay verma
Ranch Hand

Joined: Dec 10, 2007
Posts: 37
i know the 4 scopes: page,request,session,application
but what is the usage of scope in jsp?
in every technologies and frame works some scopes are defined .but how they works?
pls explain it!

thank you
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

The scope of a variable determines how long it will last and who can access it. Binding a variable to context scope will cause it to last the lifetime of the application and make it available to everyone. Binding it to session will make it available only to the user who owns the session and only for the length of that session. Request scope keeps a variable alive for one request/response cycle and allows it to be accessed by different components within that cycle. Page scoped values are gone as soon as context is moved to another resource.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
ajay verma
Ranch Hand

Joined: Dec 10, 2007
Posts: 37
thanks Ben Souther
thanks a lot
i am sure that you can answer my next question also

thanks again
I agree. Here's the link:
subject: scopes in the jsp
It's not a secret anymore!