Expression Language表达式语言,用于简化JSP页面内的Java代码
主要功能:获取数据
语法:${expression}
${brands}:获取域中存储的key为brands的数据
注意:jsp中默认支持el表达式。如果要忽略el表达式
isELIgnored="true"忽略当前jsp页面中所有的el表达式运算符
1、el表达式只能从域对象汇总获取值
2、语法:
el表达式获取数据,会一次从这四个域中寻找,直到找到为止

<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="true">
<h1>true</h1>
</c:if>
items:被遍历的容器
var:遍历产生的临时变量
varStatus:遍历状态对象(count从1开始,)
<c:forEach items="${bands}" var="brand">
<tr align="center">
<td>${brand.id}</td>
//getID()
//${brand,id}-->ID--->getID
<td>${brand.brandName}</td>
<td>${brand.companyName}</td>
</tr>
</c:forEach>
begin:开始数
end:结束数
step:步长
<c:forEach begin="0" end="10" step="1" var="i">
${i}
</c:forEach>
MVC是一种分层开发的模式其中:
MVC的优点
对数据库的CRUD基本操作
对业务逻辑进行封装,组合数据访问层层中基本功能,形成复杂的业务逻辑功能
接受请求封装,封装数据,调用业务逻辑层,响应数据

配置JSP页面的
<%@include file="top.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
prefix:前缀,自定义的
| 变量名 | 真实类型 | 作用 |
|---|---|---|
| pageContext | PageContext | 当前页面共享数据,还可以获取其他八个内置对象 |
| request | HttpServletRequest | 一次请求访问的多个资源(转发) |
| session | HttpSession | 一次会话的多个请求区间 |
| application | ServletContext | 所有用户共享数据 |
| response | HttpServletResponse | 响应对象 |
| page | Object | 当前页面(Servlet)的对象 this |
| out | JSPWrite | 输出当前对象,数据输出到页面 |
| config | ServletConfig | Servlet内置对象 |
| exception | Throwable | 异常对象 |
| page | request | session | application |
|---|---|---|---|
| 当前页面 | 一次请求 | 一次会话 | 全局(基于整个项目) |