本帖最后由 lihao1129 于 2009-08-06 16:53:09 编辑

解决方案 »

  1.   

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'index.jsp' starting page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <link rel="stylesheet" href="CSS/table.css" type="text/css">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <script type="text/javascript" src="dwr/engine.js"></script>
       <script type="text/javascript" src="dwr/util.js"></script>
       <script type="text/javascript" src="dwr/interface/service.js"></script>
      
    <script type="text/javascript" src="js/comm.js"></script>
     <script type="text/javascript">
    function dolist(){
    window.alert("dolist");
    document.forms[0].action+="?method=HmainList";
    document.forms[0].submit();
    }
    function toAdd(){
    window.alert("toAdd");
    document.forms[0].action+="?method=toAdd";
    document.forms[0].submit();
    }
    function toAddI(){
    //测试
    window.alert("toAddI");
    document.forms[0].action+="?method=toAdd";
    window.alert(document.forms[0].action);
    }
    </script>
      </head>
     
      
      
      <body>
    <form method="post" action="main.do">
    <!--  -->
    <table width="100%">
    <tr>
    <td><font color="#0000CC">您正在做的业务是:数  据</font></td>
    </tr>
    </table>
    <select name="hdmainId" style="SELECT_STYLE1">
    <option value="1">--请选择--</option>
    <option value="2">${list.hdmainName}</option>
    </select>
    <input type="button" value="添加" onclick="javascript:toAdd();">
    <input type="button" value="查询" onclick="javascript:dolist();">
    <table width="100%" border="1" cellpadding=0 cellspacing=1
    bordercolorlight=#848284 bordercolordark=#eeeee
    class="TABLE_STYLE1">
    <tr align="center">
    <td width="10%" class="TD_STYLE1">
    公司名称
    </td>
    <td width="10%" class="TD_STYLE1">
    ATA章节号
    </td>
    <td width="10%" class="TD_STYLE1">
    件号
    </td>
    <td width="10%" class="TD_STYLE1">
    测试(工时)
    </td>
    <td width="10%" class="TD_STYLE1">
    修理(工时)
    </td>
    <td width="10%" class="TD_STYLE1">
    翻修(工时)
    </td>
    <td width="10%" class="TD_STYLE1">
    修理(固定)
    </td>
    <td width="10%" class="TD_STYLE1">
    翻修(固定)
    </td>
    <td width="10%" class="TD_STYLE1">
    保修期
    </td>
    <td width="10%" class="TD_STYLE1">
    周期
    </td>
    </tr>
    <logic:iterate id="list" name="list" 
    type="com.whhd.hd.entity.Hdmian">
    <tr align="center">
    <td class="TD_STYLE2">
    <bean:write name="list" property="hdmainName"/>
    </td>
    <td class="TD_STYLE2">
    ${list.hdmainAta}
    </td>
      <td class="TD_STYLE2">
    ${list.hdmainArticleId}
    </td>
    <td class="TD_STYLE2">
    ${list.manhour.manhourTest}
    </td>
    <td class="TD_STYLE2">
    ${list.manhour.manhourRepair}
    </td>
    <td class="TD_STYLE2">
    ${list.manhour.manhourOverhaul}
    </td>
    <td class="TD_STYLE2">
    ${list.immobility.immobilityRepair}
    </td>
    <td class="TD_STYLE2">
    ${list.immobility.immobilityOverhaul}
    </td>
    <td class="TD_STYLE2">
    ${list.hdmainWarrantyTime}
    </td>
    <td class="TD_STYLE2">
    ${list.hdmainCycle}
    </td>
    </tr>
    </logic:iterate>
    </table>
    </form>
      </body>
    </html>
      

  2.   

    com.whhd.hdDate.entity.Hdmain cannot be resolved to a type
    <logic:iterate id="list" name="list" 
                    type="com.whhd.hd.entity.Hdmian">
    把type=="com.whhd.hd.entity.Hdmian"去掉
      

  3.   

    删除这个没有用哈,就会报错 Cannot find bean: "list" in any scope
    不能查找实体LIST