Jsp的表达式语言(el)
来源:互联网 发布:java双向关联的源代码 编辑:程序博客网 时间:2024/04/30 00:43
推荐网址:
http://www.oracle.com/technology/global/cn/sample_code/tutorials/jsp20/simpleel.html
http://www.ibm.com/developerworks/cn/java/j-jstl0211/
实例:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%@ include file="test.jsp" %>
<h1>JSP Page</h1>
<%
pageContext.setAttribute("color","#FFFFCC");
%>
<body bgcolor = '${pageScope.color}' >
<h1>变化的背景色</h1>
<h1>比较运算符</h1>
<b>
4 > 3 $...{4 > 3}<br/>
4 < 3 $...{4 < 3}<br/>
4 ≥ 3 $...{4 >= 3}<br/>
4 ≤ 3 $...{4 le 3} <br/>
4 = 4 $...{4 == 4}
</b>
<h1>Empty 运算符</h1>
$...{empty(Null)}
$...{empty("test")}
<b>
</b>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello $...{param.name}!
</c:if>
--%>
</body>
</html>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%@ include file="test.jsp" %>
<h1>JSP Page</h1>
<%
pageContext.setAttribute("color","#FFFFCC");
%>
<body bgcolor = '${pageScope.color}' >
<h1>变化的背景色</h1>
<h1>比较运算符</h1>
<b>
4 > 3 $...{4 > 3}<br/>
4 < 3 $...{4 < 3}<br/>
4 ≥ 3 $...{4 >= 3}<br/>
4 ≤ 3 $...{4 le 3} <br/>
4 = 4 $...{4 == 4}
</b>
<h1>Empty 运算符</h1>
$...{empty(Null)}
$...{empty("test")}
<b>
</b>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello $...{param.name}!
</c:if>
--%>
</body>
</html>
结果:
test
JSP Page
变化的背景色
比较运算符
4 > 3 true
4 < 3 false
4 ≥ 3 true
4 ≤ 3 false
4 = 4 true
Empty 运算符
true false
- Jsp的表达式语言(el)
- JSP表达式语言(EL)
- JSP- EL表达式语言
- jsp---->EL表达式语言
- [JSP]EL表达式语言
- jsp表达式语言EL导致的问题
- 0906 JSP的表达式语言EL
- JSP表达式语言----EL语言
- [Servlet&JSP] 表达式语言EL
- 初始JSP表达式语言-EL
- 表达式语言(EL)---JSP
- 09. JSP EL表达式语言
- jsp的EL表达式
- jsp的EL表达式
- JSP的EL表达式
- jsp的EL表达式
- 揭秘EL表达式语言的基础总结-JSP编程教程
- JSP中EL表达式语言不能使用的解决方法
- 匈牙利算法求二分图的最大匹配
- c#中什么情况下用(int)什么情况下用Convert.ToInt32?
- 我看设计模式
- 定制自己的EVC4.0中文模拟器
- Javascript中最常用的55个经典技巧(28-55)
- Jsp的表达式语言(el)
- 写Form设计器尝试(三) 在窗体上添加控件
- 【影评】刺杀神枪手
- 郭田勇:从紧货币政策或将会在后几个月适度放松
- asp.net2.0学习历程 菜鸟到中级程序员的飞越
- [java]如何在项目中用好log4J写项目日志
- ASP.NET网络编程中常用到的27个函数集.
- 微软发布了ASP.NET MVC源代码
- 怎样做小游戏挖金子(VC,源码2)