fn函数

fn:contains(string, substring) 如果参数string中包含参数substring,返回true
fn:containsIgnoreCase(string, substring) 如果参数string中包含参数substring(忽略大小写),返回true
fn:endsWith(string, suffix) 如果参数 string 以参数suffix结尾,返回true
fn:escapeXml(string) 将有特殊意义的XML (和HTML)转换为对应的XML character entity code,并返回
fn:indexOf(string, substring) 返回参数substring在参数string中第一次出现的位置
fn:join(array, separator) 将一个给定的数组array用给定的间隔符separator串在一起,组成一个新的字符串并返回。
fn:length(item) 返回参数item中包含元素的数量。参数Item类型是数组、collection或者String。如果是String类型,返回值是 String中的字符数。
fn:replace(string, before, after) 返回一个String对象。用参数after字符串替换参数string中所有出现参数before字符串的地方,并返回替换后的结果
fn:split(string, separator) 返回一个数组,以参数separator 为分割符分割参数string,分割后的每一部分就是数组的一个元素
fn:startsWith(string, prefix) 如果参数string以参数prefix开头,返回true
fn:substring(string, begin, end) 返回参数string部分字符串, 从参数begin开始到参数end位置,包括end位置的字符${fn:substring("ABC","1","2")}截取结果为“ B ”。
fn:substringAfter(string, substring) 返回参数substring在参数string中后面的那一部分字符串
fn:substringBefore(string, substring) 返回参数substring在参数string中前面的那一部分字符串,${fn:substringBefore("ABCD","BC")}截取的结果为“ A ”。
fn:toLowerCase(string) 将参数string所有的字符变为小写,并将其返回
fn:toUpperCase(string) 将参数string所有的字符变为大写,并将其返回
fn:trim(string) 去除参数string 首尾的空格,并将其返回

案例:

<c:if test="${fn:containsIgnoreCase(log.publishDate,wk)}">
                                       <li>
                                         <div class="timeline_comm">
                                            <!--日志发布时间-->
                                            <div class="timeline_title">
		                                    <div class="title_pic"></div>	
		                                    <!--根据日期显示星期-->		                                                                       
		                                      <div class="span" id="lzhz${log.id}">
		                                         <script>												
													var a = getWeek('${log.publishDate}');
													$("#lzhz${log.id}").text(a);												
		                                         </script>		                                    
		                                      </div>
		                                      <div class="timeline_title_rq" id="lzhd${log.id}">
		                                          <script>												
													var c = getDate('${log.publishDate}');
													$("#lzhd${log.id}").text(c);												
		                                          </script>
		                                       </div> 
	                                        </div>
	                                        <!--日志发布内容-->
	                                        <div class="timeline_nr" >
	                                          <p class="timeline_tm"></p>
	                                          <p class="timeline_xqrz" id="timezzf${log.id}">	                                          
		                                      <c:if test="${fn:length(log.summary)>=50}">
		                                     	 ${fn:substring(log.summary,0,50)}...
		                                      </c:if>
		                                      <c:if test="${fn:length(log.summary)<50}">
		                                      	${log.summary}
		                                      </c:if>
	                                          </p>
	                                          <!--日志附件-->
	                                          <c:if test="${fn:length(log.docAttaches)>0}">
														<div class="fujianlist">
															<dl>
																<c:forEach var="attach" items="${log.docAttaches}">
																<dd>附件列表:</dd>
																	<c:if test="${attach.docType == 1}">
																		<dd>
																			<a href="javascript:void(0);">${attach.docName}</a>
																			<span>
																			<a href="${ctx}${attach.docPath}">预览</a>
																			</span>
																		</dd>
																	</c:if>
																	<c:if test="${attach.docType != 1}">
																		
																		<dd>
																			<a href="javascript:void(0);">${attach.docName}</a>
																			<span>
																			<a href="${ctx}${attach.docPath}">下载</a>
																			</span>
																		</dd>
																	</c:if>
																</c:forEach>
															</dl>
														</div>
							                  </c:if>
	                                          <!--日志评论、转发-->                                        
	                                          <div class="timeline_cz right">
		                                          <span class="left" id="rzft${log.id }">
		                                          <script>
		                                          	var d = getDateTimeM('${log.publishDate}');
													$("#rzft${log.id}").text(d);	
													</script>
		                                          </span>
		                                          <span class="timeline_cza right">
			                                          <a href="javascript:void(0);" οnclick="rzpl('${log.id}','${log.id}','${ctx}',1);" id="time_rzpl${log.id}">评论(<span id="review${log.id}">${log.reviewNum}</span>)</a>
			                                          <a href="javascript:void(0);" οnclick="timerzzf('${UserName}','${log.id}')">转发(<span id="transmit${log.id}">${log.forwardNum}</span>)</a>
		                                          </span>
		                                          <br/>
					                              <span id="${log.id}" style="background-color: gray; color: #FFFFFF; margin-left: 80px; font-size:14px; height: 20px; font-weight: bold;"></span>
	                                          </div> 
	                                        </div>
	                                        <!--加载评论--> 
	                                        <div id="time_rzpinglun${log.id}" class="time_pinglun left" style="display: none;">
		                                     	 <div class="time_pinglunlist" >
                                				     <ul id="divxs${log.id}">
                                				      <!--评论拼接显示的地方-->
                                				     </ul>
                             					     <div class="more" id="morerz_${vs.count}" style="display: none">
	                             					      <a href="javascript:void(0);" id="jzgdrz_${log.id}" οnclick="loadmorerz('${log.id}','${ctx }','${log.id}',1);" title="加载更多">更多评论</a>
                             					    </div>
				                                </div>
	                                            <div class="pl_text" id="plnr_${log.id}"  contenteditable="true" οnfοcus="logfoc('${log.id}','1');"></div>
	                                            <input class="gb_bt" type="button" value="发表" id="rzfb_${log.id}"  οnclick="subzr('${log.id}','${log.id}','${user.id}',1,'${ctx }');" style="display: none;"/>
		                                    </div>                                                   
                                         </div> 
                                         <div class="timeline_comjt"></div>                                      
                                       </li>
                                     </c:if>


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值