本文介绍了ServletContext和Session对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们从请求对象(HttpServletRequest)获取的ServletContext和Session对象的行为是否相同?

Is the ServletContext and Session object which we get from request object (HttpServletRequest) behave the same ?

推荐答案

会话是用户具体。

Servlet上下文基本上是全局的(在该servlet的上下文中),这意味着命中该servlet的所有用户将共享相同的servlet上下文。

Servlet contexts are essentially global (within the context of that servlet), meaning all users who hit that servlet will share the same servlet context.

这篇关于ServletContext和Session对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 12:41