D
D
Danil Ochagov2018-06-12 14:45:53
Java
Danil Ochagov, 2018-06-12 14:45:53

What is bean scope in jsp?

What is the scope of a bean in jsp?
This allegedly created a copy of the bean on one page, but can it be further used (get it, network it) on other pages?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
P_Alexander, 2018-06-12
@P_Alexander

It's like if the scope is session then this variable will be visible while the session lasts.
Here HERE
Here in this book about scopes and about jsp it is well written

JSTL. Практическое руководство для JSP-программистов.

P
pi314, 2018-06-12
@pi314

Yes, something like this ... here's more .
In fact, instances, as such, are created and destroyed automatically by the JSP itself. We do not write new MyBean () in our code, but simply say that we want to use an instance of such a class here. And which instance it will turn out to be, and whether it needs to be created or it has already been created in this scope, depends on the context of which page, request, session, or even which launch of our application we are ... yes, yes! Instances of the Application scope are destroyed when the application is restarted. Accordingly, Page after leaving the page, Request - after processing each individual request, and Session - after closing the session. The JSP takes care of this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question