zoukankan      html  css  js  c++  java
  • JSP页面使用EL表达式不显示实际数据

    今天在学习有关jsp的相关知识内容时,遇到了el表达式只是显示括号里面的内容

    代码如下:

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>Title</title>
    </head>
    <body>
    <%
        Map maps = new HashMap();
        maps.put("aaa","111");
        maps.put("bbb","222");
        maps.put("ccc","333");
        request.setAttribute("map",maps);
    %>
    获取Map指定key的value值
    ${map.aaa}--------${map["bbb"]}
    </body>
    </html>

    显示如下:

    修改后代码: 加上<%@page isELIgnored="false"%>

    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@page isELIgnored="false"%>
    <html>
    <head>
        <title>Title</title>
    </head>
    <body>
    <%
        Map maps = new HashMap();
        maps.put("aaa","111");
        maps.put("bbb","222");
        maps.put("ccc","333");
        request.setAttribute("map",maps);
    %>
    获取Map指定key的value值
    ${map.aaa}--------${map["bbb"]}
    </body>
    </html>

    结果显示:

     

     

  • 相关阅读:
    leetcode : 3 sum
    leetcode : Merge two sorted lists
    算法:海量数据问题
    计算机基础:数据库
    计算机基础:Linux
    Java:JVM
    Java:Basic/集合框架/多线程
    Java:面试题
    框架:SSM整合
    LeetCode: Tags-[Bit Manipulation]
  • 原文地址:https://www.cnblogs.com/lx06/p/15729939.html
Copyright © 2011-2022 走看看