reset password
Author Message
rmoussa
Posts: 10
Posted 16:25 Jun 18, 2019 |

If we can't use application scope for the lab, then what other scope are we going to use? Also, how do we know whether we are using application scope or not?

Victor
Posts: 23
Posted 17:04 Jun 18, 2019 |

If we can't use application scope for the lab, then what other scope are we going to use?

Just create a variable in the servlet.

Also, how do we know whether we are using application scope or not?

int a = 0; ---> Variable in a servlet

getServletContext().setAttribute("a", 0); ---> Variable in the application scope.