用户登录
用户注册

分享至

JSP中使用EL表达式 ieELIgnoed问题

  • 作者: 传说中的若若
  • 来源: 51数据库
  • 2021-07-30
在JSP中使用EL表达式时,需要标识 isELIgnored="false",不然EL表达式是作为普通的字符串来编译的,而在页面上也不会显示出正确的值。

 

 

 

 

[html]  

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8" isELIgnored="false"%>  

<%@ taglib uri="http://www.51sjk.com/Upload/Articles/1/0/254/254086_20210627003752620.jpg prefix="c" %>  

  

<c:out value="${param.para1}" default="hello world">  

 

在apache-tomcat-6.0.35-src中可以看到这一点:

 

[java] 

protected String[] generateJava() throws Exception {  

  

        String[] smapStr = null;  

  

        long t1, t2, t3, t4;  

  

        t1 = t2 = t3 = t4 = 0;  

  

        if (log.isDebugEnabled()) {  

            t1 = System.currentTimeMillis();  

        }  

  

        // Setup page info area  

        pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader(),  

                errDispatcher), ctxt.getJspFile());  

  

        JspConfig jspConfig = options.getJspConfig();  

        JspConfig.JspProperty jspProperty = jspConfig.findJspProperty(ctxt  

                .getJspFile());  

  

        /* 

         * If the current uri is matched by a pattern specified in a 

         * jsp-property-group in web.xml, initialize pageInfo with those 

         * properties. 

         */  

        if (jspProperty.isELIgnored() != null) {  

            pageInfo.setELIgnored(JspUtil.booleanValue(jspProperty  

                    .isELIgnored()));  

        }  

 

 

软件
前端设计
程序设计
Java相关