<logic:iterate id="sightList" name="sightList">
<TR>
<TD width="100%"><IMG
src="index/images/article_ontop.gif" alt=固顶文章 width="9" height="15"> <SPAN
class=S_headline2>[组图]</SPAN><strong size="3"><font color="red">
<bean:write name="sightList" property="sightName"/></font></strong>
<html:link page="/everySightList.do" paramId="sightId" paramName="sightList" paramProperty="sightId"> <bean:write name="sightList" property="sightIntroduce"/></html:link>
<BR></TD></TR>
</logic:iterate>在以上代码中:
bean标签中要显示的内容怎样用省略号代替?
<TR>
<TD width="100%"><IMG
src="index/images/article_ontop.gif" alt=固顶文章 width="9" height="15"> <SPAN
class=S_headline2>[组图]</SPAN><strong size="3"><font color="red">
<bean:write name="sightList" property="sightName"/></font></strong>
<html:link page="/everySightList.do" paramId="sightId" paramName="sightList" paramProperty="sightId"> <bean:write name="sightList" property="sightIntroduce"/></html:link>
<BR></TD></TR>
</logic:iterate>在以上代码中:
bean标签中要显示的内容怎样用省略号代替?
解决方案 »
- 各位前辈,您好,用JS增加一行数据库为什么不成功,在线等,谢谢
- sina应用平台开始支持Java了,期待啊。有需要jsp服务器的哥们有福了,快来注册
- ireport报表如何制作宽度大于高度,且页面方向为“纵向”的报表
- 新手关于 HttpSession
- 看的电子工业出版社的《jsp宝典》,有一例程照书上的方法做始终运行出错,求助各位了
- webservices Couldn't find a binding provider
- cewolf 问题请教!
- 关于调度问题,用JSP实现,请高手及有经验的达人进来发表高见.谢谢!
- 如何实现用email将指定文件发送给用户??
- spring webservice问题
- jsp bean分页的问题
- if(rs.next()),每次提示都是java.lang.NullPointerException. System.out.println(rs1);输出为null.为什么呀.谢谢.新年快乐!
<c:out value="${fn:substring(字符串,0,7)}"/>...
</c:if>
<c:if test="${fn:length(字符串)<=10}">
<c:out value="${字符串}"/>
</c:if>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<c:set var="test" value="1234567890123456789" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'testString.jsp' starting page</title>
</head>
<body>
<c:if test="${fn:length(test)>10}">
<c:out value="${fn:substring(test,0,7)}" />...
</c:if>
<c:if test="${fn:length(test)<=10}">${test}</c:if>
</body>
</html>
将数据重新设到 Bean 里
process
如果你要保留10 个字符 其他的用 ...... 代替
data = data.length() > 10 ? data.substring(0, 9) + "......" : data;
难道在现实数据前,在action先做处理,然后再让数据在jsp页面中显示?