这样:
<html:select property="customerType">
<html:option value="Robert">Robert</html:option>
<html:option value="Bob">Bob</html:option>
</html:select>

解决方案 »

  1.   

    你还得把它写在<html:form>中。
    即:<html:form action="select.do">
       <html:select property="customerType">
       <html:option value="Robert">Robert</html:option>
       <html:option value="Bob">Bob</html:option>
       </html:select>
       </html:form>
    然后再建一个该form的actionForm,在其中包含变量customerType的get,set方法对即可。
      

  2.   

    大哥,能具体告诉我怎么写吗??上面的form我在页面中已经写好了,就差写方法了。请帮忙!
      

  3.   

    建一个actionForm,然后写变量customerType的get,set方法对。
    public class select extends ActionForm {
      private String customerType = null;
      
      public String getCustomerType() {
          return customerType;
    }  public void setCustomerType(String c) {
    this.customerType = c;
    }
    }
      

  4.   

    我是这样写get,set方法的,可还是不行呀!
     public String getCustomerType() {
      return this.customerType;
      }
    public void setCustomerType(String aCustomerType) {
     this.customerType = aCustomerType;
       }
      

  5.   

    404 Not Found
    /ccs/error/error.jsp was not found on this server. 
    --------------------------------------------------------------------------------
    Resin 2.1.12 (built Tue Dec 9 14:58:25 PST 2003)
      

  6.   

    你action建了吗,config文件配置了吗?
      

  7.   

    <%@ page
       language = "java"
       import = "com.kline.util.*"
       contentType = "text/html; charset = gb2312"
    %><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html><head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>CustomerEdit</title>
    <link rel="stylesheet" href="include/style.css" type="text/css">
    </head><body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align=location> <a href="main.htm">CCS</a> >> <a href="CustomerMgt.htm">Customer 
          Management </a> >> <a href="CustomerList.htm">Customer</a> >> New/Edit 
          <hr><br>
        </td>
      </tr>
      <tr>
        <td>
          <html:form method="post" action="customerAction.do">
          <html:hidden property="action"/>
            <table width="100%" border=1 cellpadding="0" cellspacing="0">
              <tr>   
                <td width="20%" align=left class="fieldName">Code</td>
                <td align=left width="30%"> 
    <html:text property="customerCode"/>
                </td>
                <td align=left width="20%" class="fieldName">Type</td>
                <td align=left width="30%"> 
                <html:select property="customerType"/>
                <html:option value="Robert">Robert</html:option>
    <html:option value="Bob">Bob</html:option>
                </html:select>
                   <!--<option value="DEPOT">DEPOT</option>
                  <option value="AGENT">AGENT</option>
                 </select>-->
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Name </td>
                <td align=left height="32" colspan="3"> 
                  <html:text property="customerName"/>
                </td>
              </tr>
              <tr bgcolor="#33CCCC"> 
                <td align=left height="32" colspan="4"><font color="#FFFFFF"><b>Registration Info.</b></font></td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Address</td>
                <td align=left height="32" colspan="3"> 
                <html:text property="customerAddress"/>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">City</td>
                <td align=left height="32">
                <html:text property="customerCity"/>
                </td>
                <td align=left height="32" class="fieldName">Province</td>
                <td align=left height="32">
                <html:text property="customerProvince"/>            
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Country</td>
                <td align=left height="32">
                <html:text property="customerCountry"/>
               </td>
                <td align=left height="32" class="fieldName">Zip</td>
                <td align=left height="32">
                <html:text property="customerZip"/>
                </td>
              </tr>
              <tr bgcolor="#33CCCC"> 
                <td align=left height="32" colspan="4"><b><font color="#FFFFFF">Shipping 
                  Info.</font></b></td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Address</td>
                <td align=left height="32" colspan="3">
                <html:text property="customerAddress1"/> 
                  </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">City</td>
                <td align=left height="32">
                <html:text property="customerCity1"/>
                </td>
                <td align=left height="32" class="fieldName">Province</td>
                <td align=left height="32">
                <html:text property="customerProvince1"/>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Country</td>
                <td align=left height="32">
                <html:text property="customerCountry1"/>
                </td>
                <td align=left height="32" class="fieldName">Zip</td>
                <td align=left height="32">
                <html:text property="customerZip1"/>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Account No.(RMB)</td>
                <td align=left height="32">
                <html:text property="customerRMB"/>
                </td>
                <td align=left height="32" class="fieldName">Account No.(USD)</td>
                <td align=left height="32">
    <html:text property="customerUSD"/>
                </td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td> <br>
                <html:submit property="Save" value="Save"/>
    <html:cancel property="Cancel" value="Cancel"/>
              </td>
              </tr>
            </table>
          </html:form>
        </td>
      </tr>
    </table>  
    </body>
    </html>
      

  8.   

    我想问一下,你把<html:select>与</html:select>之间的代码去掉后,页面好用吗,能显示吗?
      

  9.   

    <html:option value="Robert">Robert</html:option>
    <html:option value="Bob">Bob</html:option>
    </html:select>
    只要我把这个去掉,就一点问题都没有!这是怎么回事呀?大哥,一定要帮我呀!
      

  10.   

    <html:select property="customerType"/>
    改成
     <html:select property="customerType">
      

  11.   

    你<html:select property="customerType"/>
       <html:option value="Robert">Robert</html:option>
       <html:option value="Bob">Bob</html:option>
       </html:select>
    中的第一行错了,最后多了一个斜杠,应该为<html:select property="customerType">
      

  12.   

    <%@page language = "java" contentType = "text/html; charset = gb2312"%><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html><head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <title>CustomerEdit</title>
    <link rel="stylesheet" href="include/style.css" type="text/css">
    </head><body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align=location> <a href="main.htm">CCS</a> >> <a href="CustomerMgt.htm">Customer 
          Management </a> >> <a href="CustomerList.htm">Customer</a> >> New/Edit 
          <hr><br>
        </td>
      </tr>
      <tr>
        <td>
          <html:form method="post" action="customerAction.do">
          <html:hidden property="action"/>
            <table width="100%" border=1 cellpadding="0" cellspacing="0">
              <tr>   
                <td width="20%" align=left class="fieldName">Code</td>
                <td align=left width="30%"> 
    <html:text property="customerCode"/>
                </td>
                <td align=left width="20%" class="fieldName">Type</td>
                <td align=left width="30%"> 
                <html:select property="customerType"/>
                <html:option value="Robert">Robert</html:option>
    <html:option value="Bob">Bob</html:option>
                </html:select>
                   <option value="DEPOT">DEPOT</option>
                   <option value="AGENT">AGENT</option>
                </html:select>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Name </td>
                <td align=left height="32" colspan="3"> 
                  <html:text property="customerName"/>
                </td>
              </tr>
              <tr bgcolor="#33CCCC"> 
                <td align=left height="32" colspan="4"><font color="#FFFFFF"><b>Registration Info.</b></font></td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Address</td>
                <td align=left height="32" colspan="3"> 
                <html:text property="customerAddress"/>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">City</td>
                <td align=left height="32">
                <html:text property="customerCity"/>
                </td>
                <td align=left height="32" class="fieldName">Province</td>
                <td align=left height="32">
                <html:text property="customerProvince"/>            
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Country</td>
                <td align=left height="32">
                <html:text property="customerCountry"/>
               </td>
                <td align=left height="32" class="fieldName">Zip</td>
                <td align=left height="32">
                <html:text property="customerZip"/>
                </td>
              </tr>
              <tr bgcolor="#33CCCC"> 
                <td align=left height="32" colspan="4"><b><font color="#FFFFFF">Shipping 
                  Info.</font></b></td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Address</td>
                <td align=left height="32" colspan="3">
                <html:text property="customerAddress1"/> 
                  </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">City</td>
                <td align=left height="32">
                <html:text property="customerCity1"/>
                </td>
                <td align=left height="32" class="fieldName">Province</td>
                <td align=left height="32">
                <html:text property="customerProvince1"/>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Country</td>
                <td align=left height="32">
                <html:text property="customerCountry1"/>
                </td>
                <td align=left height="32" class="fieldName">Zip</td>
                <td align=left height="32">
                <html:text property="customerZip1"/>
                </td>
              </tr>
              <tr> 
                <td align=left height="32" class="fieldName" width="19%">Account No.(RMB)</td>
                <td align=left height="32">
                <html:text property="customerRMB"/>
                </td>
                <td align=left height="32" class="fieldName">Account No.(USD)</td>
                <td align=left height="32">
    <html:text property="customerUSD"/>
                </td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td> <br>
                <html:submit property="Save" value="Save"/>
    <html:cancel property="Cancel" value="Cancel"/>
              </td>
              </tr>
            </table>
          </html:form>
        </td>
      </tr>
    </table>  
    </body>
    </html>