如何在 jstl 中删除会话变量
How to remove a session variable in jstl
我想在 JSTL 中删除会话变量或将其设置为 null。请帮助我。
如果我尝试使用
<c:set var="varialbleName" value=null scope="session" />
但它给了我以下 服务器错误。
Server Error
Caused by:
org.apache.jasper.JasperException: /WEB-INF/jsps/forum.jsp (line: 78, column: 71) quote symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:276)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:92)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:223)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:163)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:154)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1231)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1453)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1666)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:996)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1271)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1453)
at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
您可以使用以下代码行删除会话变量:
<c:remove var="variableName"/>
在 Session Scope 下使用 c 删除 Jstl 的标签
<c:remove var="var_name" scope="session" />
我想在 JSTL 中删除会话变量或将其设置为 null。请帮助我。 如果我尝试使用
<c:set var="varialbleName" value=null scope="session" />
但它给了我以下 服务器错误。
Server Error
Caused by:
org.apache.jasper.JasperException: /WEB-INF/jsps/forum.jsp (line: 78, column: 71) quote symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:276)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:92)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:223)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:163)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:154)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1231)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1453)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1666)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:996)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1271)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1453)
at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
您可以使用以下代码行删除会话变量:
<c:remove var="variableName"/>
在 Session Scope 下使用 c 删除 Jstl 的标签
<c:remove var="var_name" scope="session" />