What does the dollar curly brackets ${} mean in JS

2019-03-18 09:01发布

What does ${} means in JSP? For example,

<c:if test="${!empty cookie.lang}">
    <fmt:setLocale value="${cookie.lang.value}" />
</c:if>

3条回答
神经病院院长
2楼-- · 2019-03-18 09:34

The ${} referes to EL expressions. You usually access some managed beans on the server via the EL expression.

查看更多
beautiful°
3楼-- · 2019-03-18 09:35

its an El expression basically it outputs the value that result from evaluating the expression, to put it simply, it allows you to access the values of the properties of your java beans using "dots" instead of using getters and setters, using it you can access instances of beans that can be in session,request, or page scope

查看更多
贪生不怕死
4楼-- · 2019-03-18 09:47

It is Expression Language. Before EL evolved, the same purpose was achieved by using scriptlets <%=..%>The primary purpose of using this syntax is to avoid scriptlets in jsp. Scriptlets and the enclosed java code is considered bad practise because jsps are not 'supposed' to have java code. At least that is the theory.

查看更多
登录 后发表回答