<c:if test="${fn:contains(name, searchString)}">
来源:互联网 发布:欧文季后赛数据 编辑:程序博客网 时间:2024/06/06 02:26
关于<c:if test="${fn:contains(name, searchString)}">
网上举的例子不是很好,我试了好久才成功。
还是我来举个例子吧。
-------------------------------------------------------------------------------------
JSP表单提交页面主要代码:
<form method="post" action="result.jsp">
<input type="text" name="interest" value="">
<input type="submit" value="submit">
</form>
---------------------------------------------------------------------------------------------------
JSP表单接收页面result.jsp主要代码:
<form method="post" action="">
<input type="checkbox" name="interest" value="音乐"
<c:if test="${fn:contains(param.interest,'音乐')}">
checked="checked"
</c:if>
>音乐
</form>
注:以上代码实现的功能就是,如果接收到的param.interest包含【音乐】
二字,则复选框音乐就会被选中。
-----------------------------------------------------------------------------------------------------
效果截图:
//提交页面
//接收页面
- <c:if test="${fn:contains(name, searchString)}">
- <c:if test="${fn:contains(name, searchString)}">
- c:if 通过${fn:contains(id,'')多条件判断
- 博客 文章 只显示 前100个字 java 实现截取字符串!使用! <c:if test="${fn:length(onebeans.info)>100 }">${ fn:substri
- <c:if test="">用法
- 慎用fn:contains,使用c:forEach替代
- fn:contains
- <c:if test="">多条件判断
- <c: if test="">判断无效
- select if(id,id,name) as name ,* from test
- <c:if中contains是否包含
- <c:if test>标签使用
- JSTL c if test 标签
- JSP中 <c:if test="${key1!=null}">是什么意思
- <c:if test="value ne, eq, lt, gt,...."> 用法
- <c:if test="${ }"> 两个参数比较大小
- <c:if test="value ne, eq, lt, gt,...."> 用法
- <c:if test="value ne, eq, lt, gt,...."> 用法
- 26日上午网易等多家网站无法访问“剖析”
- Struts2做下载
- jxl.read.biff.BiffException #11133 读取excel报出异常. workbook 解析excel 基本代码格式
- 一个完整的802.1X认证的交互
- Android导入项目出现bin/res错误
- <c:if test="${fn:contains(name, searchString)}">
- Android anr异常测试
- org.hibernate.HibernateException: No Session found for current thread
- auto_ptr解析
- NodeJs连接Mysql数据库
- 题目1156:谁是你的潜在朋友
- Python 超简单的聊天程序
- android中handler用法总结
- Android UI开发第三十六篇——使用Volley加载图片列表