From the course: Java EE: Servlets and JavaServer Pages (JSP)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Scopes and parameters vs. attributes

Scopes and parameters vs. attributes

From the course: Java EE: Servlets and JavaServer Pages (JSP)

Start my 1-month free trial

Scopes and parameters vs. attributes

- [Narrator] Now that we've taken a look at some of the APIs, let's talk about the concept of scopes in a web application. All the components that you have in your web app, let's say servlets, filters, listeners, GSPs, all of them talk to each other. They have to talk to each other because they need to work together in order to run the application. So talking to each other is basically by sharing information. Now think about it. Where do you want to save this information? In the database? No that's not a very good idea because if you really want to have access to the information, you need to make a database strip for it, which is going to be a costly business. And moreover, the information that you're trying to use to communicate between the different components, may really need to die out quickly. Let's say I want to store some information only for one particular request and once that request is completed, I need to get rid of that information. So that's exactly where you have the…

Contents