servlet是单身人士吗? [英] Is servlet the singleton?

查看:181
本文介绍了servlet是单身人士吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

读一些书说servlet是容器端的单例。这是真的吗?

Reading some book that said the servlet is singleton from the container side. Is this true?

然而,即使是单身,我们也需要处理数据同步等。

However even it is a singleton, we need to handle data synchronization etc

推荐答案

没有。您可以在同一个Web容器中的不同servlet名称和URL下多次实例化同一个servlet类。实际上在同一个web-app中。

No. You can instantiate the same servlet class many times under different servlet names and URLs in the same web container and indeed in the same web-app.

这篇关于servlet是单身人士吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆