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>

    结果显示:

     

     

  • 相关阅读:
    随笔练习
    获得屏幕相关的辅助类
    C# 下sqlite简单使用
    XP系统下 VS2010 选中行崩溃
    Custome Buble Data Point
    RIA
    Chart Style
    d3js
    TreeView
    [Java入门笔记] Java语言简介
  • 原文地址:https://www.cnblogs.com/lx06/p/15729939.html
Copyright © 2011-2022 走看看