Ⅰ jsp页面文字显示设置
<s:if text="headlines.length()>10">
<s:property value="headlines.tostring().substring(0, 10)/>....
</s:if>
<s:else>
..
</s:else>
Ⅱ jsp查询关键字的问题
首先你在後台判断用户输入,如果title为不空、notiice为空,那就用sql = "select * from notice where title = 'title' ',
如果是title为空、notice不为空,那就用 sql = "select * from notice where notice = 'notice' ";
如果两个都为不空(就是用户两个关键字都输入了),那就用sql = "select * from notice where title like '%title%' andnotice like '%notice'";
如果都为空,那就查找出所有或者什麼也不查找。
=========================================================
模糊查找的方案有很多种,你可以,比如“全匹配”就是完全等於、"区分大小写"等等。看你自己设计。用like是模糊查询,用“=”就是全匹配,你可以为用户增加这些选项。多个关键字一起查询,就用"and"或者"or"来连接就好了。
还是不懂的话,建议重新学一下sql语法语句吧!
Ⅲ jsp页面如何打开就将光标定位到页面上的唯一文本框里
首先,在body的标签里面 写 onload="jsmethod()"
在定义script标签里面写
function jsmethod(){
document.getElementById("query").focus()
}
Ⅳ jsp 中如何控制 文字显示的位置啊
在页面截取字符串
<%
String s = RS.getString("title");
if (s.length()>12)
{
s = s.subString(0,12)+"...";
}
%>
然后在你想输出的地方输出s就可以了