比如:我们做的新闻系统,当数字达到10时就用“......”来表示
我在jsp中
<%
String title=rsnew.getString("title");
if(title.length()>20){
title=title.substring(0,20)+"……";
}
out.print(title);
%> 我现在用struts ,怎么来表示?
比如我的字段名:<bean:write name="KmzsdForm" property="mc"/>怎么达到上面的效果呢?
大家帮忙顶!!!
我在jsp中
<%
String title=rsnew.getString("title");
if(title.length()>20){
title=title.substring(0,20)+"……";
}
out.print(title);
%> 我现在用struts ,怎么来表示?
比如我的字段名:<bean:write name="KmzsdForm" property="mc"/>怎么达到上面的效果呢?
大家帮忙顶!!!
解决方案 »
- 项目中关于请求跳转的问题(在线等待中……)
- 求救!!!!!!请高手帮忙指点一下,如何实现C++客户端上传文件到WEB服务器
- Struts配置文件问题
- 求救,tomcat启动不了。大家进来帮我看看。
- Connection reset by peer: socket write error 如何解决啊!!!保证给分
- 一个简单问题关于JSP的~~~~~~~~~~~~~急
- 写了一个jsp程序,运行之后中文显示的是乱码.这是怎么回事??给出代码和运行情况如下:
- 一个tomcat问题!急,拉兄弟一把吧!!!!在线等待
- 请问我为什么找不到javax.Servlet
- spring mybatis单元测试报Failed to load ApplicationContext错
- jsp的分页如何解决
- 子页面关闭时如何触发父页面的某一事件?
if(newText != null && newText.getByte().length > 20) {
return newText.sub+ "...";
} else
return newText;
}
title="<bean:write name="jbkmForm" property="jc"/>" target="_blank">
显示时: <bean:write name="jbkmForm" property="jc"/>
</a>显示时:为****.....当鼠标放在上面时,title则显示全部的怎么弄呢?
我对struts还不是很熟悉,麻烦说明白点了
谢谢拉
<html:hidden name="jbkmForm" property="jcHidden"/>function over(){
var elm = document.getXXXbyid(aa)//不记得这个方法了
elm.value=document.all.jcHidden.value;//能这样的扶植就好了.
}
var tempVar = "";//全局变量.存储href的innerTextfunction over(obj){
tempVar = document.all.test.innerText;//取得innerText就是<a>aaaa</a>中间的内容aaaaobj.innerText = document.all.jcHidden.value;
//alert(document.all.test.href);
//alert(document.all.test.innerText);
}function out(obj){
if(tempVar!=""){
obj.innerText=tempVar;//当书标离开就把保存的值赋回来.
}}
</script>
<bean:write name="" property="" cut="10">
cut属性可以自由定义,如上,当显示出来超过10个字符后,后面字符以省略号代替,且当鼠标放在上面时显示全部内容
自己加上去不过错?
在jsp中用<bean:write name="aa"/>即可了。呵呵。试试看