开发者

What is JSP 2 version of <c:set>?

开发者 https://www.devze.com 2023-01-16 18:15 出处:网络
How can I set a value using JSP 2? I mean, if ${val} is the new version of <c:out 开发者_开发问答value=\"${val}\" />, what is the JSP 2 version of <c:set var=\"val\" value=\"bla\" />?I th

How can I set a value using JSP 2?

I mean, if ${val} is the new version of <c:out 开发者_开发问答value="${val}" />, what is the JSP 2 version of <c:set var="val" value="bla" />?


I think you're confused. ${val} is not the new version of <c:out value="${val}" />. Both are Expression Language (EL) statements.*

In JSP 2, you still use <c:set var="val" value="bla" />.

http://en.wikipedia.org/wiki/JavaServer_Pages#JSP_2.0

*okay, okay, so while ${val} is an EL statement, <c:out value="${val}" /> is a JSTL tag that uses an EL expression.


The JSP 2 section of the Wikipedia article has parts copied verbatim from here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号