<%
  String sTitle=bean.getData("newstitle"),substring(0,10) + "....";//取前10个字然后加...
%>在显示的地方用<%=sTitle%>即可

解决方案 »

  1.   

    <%
      String sTitle=bean.getData("newstitle").substring(0,10) + "....";//取前10个字然后加...
    %>在显示的地方用<%=sTitle%>即可
      

  2.   

    <%
        String sTitle=bean.getData("newstitle");
        if (sTitle.length>10){
           sTitle = sTitle.substring(0,10) + "....";
        }
    %>
    ... ...
    <%=sTitle%>
      

  3.   

    <%
        String sTitle=bean.getData("newstitle");
        if (sTitle.length()>10){
           sTitle = sTitle.substring(0,10) + "....";
        }
    %>
    ... ...
    <%=sTitle%>