reverse 函数,countVowels 函数,EL函数的使用
2007-11-09 10:25
316 查看
reverse 函数:将传入的字符串以反向顺序输出。
countVowels 函数:计算传入的字符串中,和aeiouAEIOU 吻合的字符个数。
EL函数的使用:
Tomcat 的EL 函数范例,主要分为四个 分 (见表6-9):
表6-9
web.xml 设定taglib 的TLD 文件位置
functions.jsp 使用EL 函数的范例程序
jsp2-example-taglib.tld EL 函数、标签库的设定文件
jsp2.examples.el.Functions.java EL 函数主要程序逻辑处理 分
functions.jsp
<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib"%>
<html>
<head>
<title>JSP 2.0 Expression Language - Functions</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Functions</h1>
…. 略
<blockquote>
<u><b>Change Parameter</b></u>
<form action="functions.jsp" method="GET">
foo = <input type="text" name="foo" value="${param['foo']}">
<input type="submit">
</form>
<br>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>/${param["foo"]}</td>
<td>${param["foo"]} </td>
</tr>
<tr>
<td>/${my:reverse(param["foo"])}</td>
<td>${my:reverse(param["foo"])} </td>
</tr>
<tr>
<td>/${my:reverse(my:reverse(param["foo"]))}</td>
<td>${my:reverse(my:reverse(param["foo"]))} </td>
</tr>
<tr>
<td>/${my:countVowels(param["foo"])}</td>
<td>${my:countVowels(param["foo"])} </td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>
countVowels 函数:计算传入的字符串中,和aeiouAEIOU 吻合的字符个数。
EL函数的使用:
Tomcat 的EL 函数范例,主要分为四个 分 (见表6-9):
表6-9
web.xml 设定taglib 的TLD 文件位置
functions.jsp 使用EL 函数的范例程序
jsp2-example-taglib.tld EL 函数、标签库的设定文件
jsp2.examples.el.Functions.java EL 函数主要程序逻辑处理 分
functions.jsp
<%@ taglib prefix="my"
uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib"%>
<html>
<head>
<title>JSP 2.0 Expression Language - Functions</title>
</head>
<body>
<h1>JSP 2.0 Expression Language - Functions</h1>
…. 略
<blockquote>
<u><b>Change Parameter</b></u>
<form action="functions.jsp" method="GET">
foo = <input type="text" name="foo" value="${param['foo']}">
<input type="submit">
</form>
<br>
<code>
<table border="1">
<thead>
<td><b>EL Expression</b></td>
<td><b>Result</b></td>
</thead>
<tr>
<td>/${param["foo"]}</td>
<td>${param["foo"]} </td>
</tr>
<tr>
<td>/${my:reverse(param["foo"])}</td>
<td>${my:reverse(param["foo"])} </td>
</tr>
<tr>
<td>/${my:reverse(my:reverse(param["foo"]))}</td>
<td>${my:reverse(my:reverse(param["foo"]))} </td>
</tr>
<tr>
<td>/${my:countVowels(param["foo"])}</td>
<td>${my:countVowels(param["foo"])} </td>
</tr>
</table>
</code>
</blockquote>
</body>
</html>
相关文章推荐
- 【c语言】编写一个函数reverse_string(char * string) 实现:将参数字符串中的字符反向排列。 要求:不能使用C函数库中的字符串操作函数
- 不使用reverse之类的系统函数,用java写一段倒序输出字符串的函数
- MDX Step by Step 读书笔记(六) - Building Complex Sets (复杂集合的处理) - TopCount - BottomCount - Head - Tail - Item 函数的使用
- TSQL中 Count() 函数使用的一点小技巧
- 练习 1-19 编写函数 reverse(s),将字符串s 中的字符顺序颠倒过来。使用该函数 编写一个程序,每次颠倒一个输入行中的字符顺序。
- 使用SQL字符串反转函数REVERSE巧妙实现lastindexof功能
- 练习1-19 编写函数 reverse(s),将字符串s 中的字符顺序颠倒过来。使用该函数编写一个程序,每次颠倒一个输入行中的字符顺序。
- 编写一个函数reverse_string(char * string)(递归实现) 实现:将参数字符串中的字符反向排列。 要求:不能使用C函数库中 的字符串操作函数。
- ORACLE--COUNT()函数使用
- javascript 数组排序函数sort和reverse使用介绍
- TSQL中 Count() 函数使用的一点小技巧
- mysql中MAX()函数和count()函数的技巧使用
- //4. 编写一个函数reverse_string(char * string)(递归实现) //实现:将参数字符串中的字符反向排列。 //要求:不能使用C函数库中的字符串操作函数。
- count(*)函数的使用
- Django url 标签和reverse()函数的使用(转)
- 解决使用VC运行时库函数wprintf和wcount显示中文不正确的问题
- 编写一个函数reverse_string(char * string) 实现:将参数字符串中的字符反向排列。 要求:不能使用C函数库中的字符串操作函数。
- 【C语言】编写一个函数reverse_string(char * string) 实现:将参数字符串中的字符反向排列。要求:不能使用C函数库中的字符串操作函数。
- PowerBuilder中使用JDBC连接MYSQL 无法使用COUNT(*) MAX() 函数的处理
- 如何在ContentProvider中使用COUNT()函数