iframe.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0011)about:blank -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3354" name=GENERATOR></HEAD>
<BODY>
<table>
<tr>
<td>
<iframe name="main" width="50" height="150" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" noresize src="../portal/portalinform.jsp?width=50&height=150"></iframe>
<!--这里的width  和height 都是作为参数传入到myjsp.jsp页面 -->
</td></tr>
</table>
</BODY></HTML>myjsp.jsp<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.fabu.InformUtil"%>
<%@ page import="com.fabu.Inform"%>
<%
InformUtil util = new InformUtil();
util.setPageSize(100); //最大滚动条目假设不超过100
util.setCurrentPage(1);
//设定返回页面的信息
ArrayList list = util.getAllInfoListByPage();
//移动区域高度
int intHeight = ParamUtils.getIntParameter(request,"height",130);
//移动区域宽度
int intWidth = ParamUtils.getIntParameter(request,"width",200);
//显示颜色
String color = ParamUtils.getParameter(request, "color", "696969");
%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style>a{TEXT-DECORATION:none}</style>
<style>
#asd td { border-bottom: 0px dotted #cecece;line-height:25px;}
</style>
</head>
<table cellpadding="0" csllspacing="0" align="left" width="<%=intWidth%>" border="0" id="asd">
<tr>
    <td valign="left">
   <%
      Inform info = null;
      int count =0;
      for(int i=0; i<list.size(); i++){
        info = (Inform)list.get(i);%>
        <a href='<%=info.getUrl()%>' target=_blank>
          <font color='blue' size=2><%=title1%></font>
        </a><br>
      <%}%>
    </td>
  </tr> 
</table>

解决方案 »

  1.   

    感觉 楼主的myjsp.jsp这个文件写的有很大问题!
      

  2.   

    哦,错了,这里不能有scrolling="no"
    这个页面是别的公司的,另外引入的类是外部包,大概形式是这样的,
    只想大家给个思路或者解决方法。谢谢,如果分不够可以再加分。
    iframe.html 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
    <!-- saved from url=(0011)about:blank --> 
    <HTML> <HEAD> 
    <META http-equiv=Content-Type content="text/html; charset=unicode"> 
    <META content="MSHTML 6.00.2900.3354" name=GENERATOR> </HEAD> 
    <BODY> 
    <table> 
    <tr> 
    <td> 
    <iframe name="main" width="50" height="150"  frameborder="0" marginwidth="0" marginheight="0" noresize src="../portal/portalinform.jsp?width=50&height=150"> </iframe> 
    <!--这里的width  和height 都是作为参数传入到myjsp.jsp页面 --> 
    </td> </tr> 
    </table> 
    </BODY> </HTML> 
      

  3.   

    iframe.html 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
    <!-- saved from url=(0011)about:blank --> 
    <HTML> <HEAD> 
    <META http-equiv=Content-Type content="text/html; charset=unicode"> 
    <META content="MSHTML 6.00.2900.3354" name=GENERATOR> </HEAD> 
    <BODY> 
    <table> 
    <tr> 
    <td> 
    <iframe name="main" width="50" height="150"  frameborder="0" marginwidth="0" marginheight="0" noresize src="myjsp.jsp?width=50&height=150"> </iframe> 
    <!--这里的width  和height 都是作为参数传入到myjsp.jsp页面 --> 
    </td> </tr> 
    </table> 
    </BODY> </HTML> myjsp.jsp <%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%> 
    <%@ page import="java.util.ArrayList"%> 
    <%@ page import="com.fabu.InformUtil"%> 
    <%@ page import="com.fabu.ParamUtils"%> 
    <%@ page import="com.fabu.Inform"%> 
    <% 
    InformUtil util = new InformUtil(); 
    util.setPageSize(100); //最大滚动条目假设不超过100 
    util.setCurrentPage(1); 
    //设定返回页面的信息 
    ArrayList list = util.getAllInfoListByPage(); 
    //移动区域高度 
    int intHeight = ParamUtils.getIntParameter(request,"height",130); 
    //移动区域宽度 
    int intWidth = ParamUtils.getIntParameter(request,"width",200); 
    //显示颜色 
    String color = ParamUtils.getParameter(request, "color", "696969"); 
    %> <html> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <title> </title> 
    <style>a{TEXT-DECORATION:none} </style> 
    <style> 
    #asd td { border-bottom: 0px dotted #cecece;line-height:25px;} 
    </style> 
    </head> 
    <table cellpadding="0" csllspacing="0" align="left" width=" <%=intWidth%>" border="0" id="asd"> 
    <tr> 
        <td valign="left"> 
      <% 
          Inform info = null; 
          int count =0; 
          for(int i=0; i <list.size(); i++){ 
            info = (Inform)list.get(i);%> 
            <a href=' <%=info.getUrl()%>' target=_blank> 
              <font color='blue' size=2> <%=title1%> </font> 
            </a> <br> 
          <%}%> 
        </td> 
      </tr> 
    </table> 
      

  4.   

    里面最关键得问题是你title1显式得内容不能够很好的控制。你可以取一下title1的字符。用substring函数,最多取5个汉字,其他的用省略号代替,反正你得程序还有超链接显示详细内容。我一般做系统的时候就是这样处理得。
      

  5.   

    String title1 = info.getTitle();
             String allTitle=title1;
             int allTitleLength=allTitle.length()*13;
             int sigleHang =0;
             if(allTitleLength>intWidth){
             sigleHang =2;
             }else{ sigleHang =1;}
             hangshu+=sigleHang ;
               int width=intWidth/20;
    if(info.getTitle().length()>width){title1=info.getTitle().substring(0,width)+"...";}else
    title1= info.getTitle();楼主你看看。