EL & JSTL

EL与JSTL表达式
 
1、EL表达式:Jsp内置的表达式语言
          隐式内置对象:
              1> pageScope: 当前JSP页面有效
              2> requestScope 在整个请求区间有效
              3> sessionScope 在整个会话区间有效
              4> applicationScope 在应用存活区间有效
              
          el表达式在解析变量时,如果变量前没有带隐式内置对象,则会从pageScope 开始一直查找到applicationScope
          
2、JSTL表达式:JavaServer Pages Standard Tag Library 开放源代码的JSP标准标签库
    五大标签库:
        1> 核心标签库 (Core tag library) 重点掌握  c
        2> I18N格式标签库 (I18N-capable formatting tag library) 国际化 和日期  数字格式化  fmt
        3> SQL标签库 (SQL tag library)  sql过期不使用
        4> XML标签库 (XML tag library)  xml过期不使用
        5> 函数标签库 (Functions tag library) 过期不使用
    使用方法:
        1>在pom.xml中引入Jstl  
            <dependency>
                <groupId>jstl</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
            </dependency>
        2>在jsp页面导入标签库
            <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
            <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

posted @ 2017-12-11 01:31  Shevo  阅读(127)  评论(0)    收藏  举报