e1052. preventing the creation of a session in a jsp page.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 14 行
TXT
14 行
By default, a JSP page will automatically create a session for the request if one does not exist. However, sessions consume resources and if it is not necessary to maintain a session, one should not be created. For example, a marketing campaign may suggest the reader visit a web page for more information. If it is anticipated that a lot of traffic will hit that page, you may want to optimize the load on the machine by not creating useless sessions.
The page directive is used to prevent a JSP page from automatically creating a session:
<%-- Prevent the creation of a session --%>
<%@ page session="false">
<html>
<head><title>A Session-less JSP Page</title></head>
<body>
...
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?