0
点赞
收藏
分享

微信扫一扫

EL 表达式:${表达式}

倪雅各 2022-02-19 阅读 160
前端jsp

EL 表达式主要是代替 jsp 页面中的表达式脚本在 jsp 页面中进行数据的输出。

jsp 页面中的表达式脚本

EL 表达式:

  

  • EL 获取四个特定域中的属性

当四个域中都有相同的 key 的数据的时候,EL 表达式会按照四个域的从小到大的顺序去进行搜索,找到就输出

pageScope ====== pageContext 域

requestScope ====== Request 域

sessionScope ====== Session 域

applicationScope ====== ServletContext 域

<%
    pageContext.setAttribute("key1", "pageContext1");
    pageContext.setAttribute("key2", "pageContext2");
    request.setAttribute("key2", "request");
    session.setAttribute("key2", "session");
    application.setAttribute("key2", "application");
%>
    ${applicationScope.key2}<br/>
    ${pageScope.key2}

举报

相关推荐

0 条评论