• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What are context attributes?

 
Sagar S Shah
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand the context init parameters,servlet init parameters etc. but i dont seem to understand what context attributes exactly are and what are they used for???Can someone please explain it to me in simple words??

Thanks in advance.
 
Gaurangkumar Khalasi
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar S Shah wrote:Can someone please explain it to me in simple words??

Context init parameters -- attached with web application...
Servlet init parameters -- attached with a specific servlet...
 
Sagar S Shah
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gaurangkumar Khalasi wrote:
Sagar S Shah wrote:Can someone please explain it to me in simple words??

Context init parameters -- attached with web application...
Servlet init parameters -- attached with a specific servlet...


yeah i get that...i want to know what are context attibutes.
 
Gaurangkumar Khalasi
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar S Shah wrote:...i want to know what are context attibutes.

Attributes which will be shared by servlets of a particular Web application...
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar S Shah wrote:yeah i get that...i want to know what are context attibutes.


They are attributes of the web application. Data items which are specific to the web application as a whole.
 
Sagar S Shah
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you guys saying that it is the data that is common to the entire web app???In that case how is it different from context init parameters??Also i think now i dont really understand what an attribute is.So what is an attibute exactly??

Thanks for all the help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If by "attribute" you mean scoped variables that are set and fetched from the various contexts using setAttribute() and getAttribute(), then they are very different from context parameters.

Context parameters are set in the deployment descriptor and are static.

Scoped variables places in application context are set by code and can be changed at any time.

A better and unambiguous term is scoped variables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic