public Acton Errors validate(ActionMapping mapping,HttpServletRequest request),在这个函数里可以吧?

解决方案 »

  1.   

    不需要任何处理吧,只要和ActionForm对应好了就可以了吧。
      

  2.   

    用session啊 ,如果用同一个FormBean也可以
      

  3.   

    但是如果取到select的选项呢?ActionForm里不可能去查询数据库的呀
      

  4.   

    我的struts-config.xml:
    <action path="/admin/editbuyerenter" type="cn.sh.online.auction.layout.actions.admin.buyer.EditBuyerEnterAction">
          <forward name="success" path="/admin/buyer/editbuyer.jsp" />
    </action>
    <action path="/admin/editbuyer" name="editBuyerForm"
    type="cn.sh.online.auction.layout.actions.admin.buyer.EditBuyerAction"
    input="/admin/buyer/editbuyer.jsp" scope="request" />edit.jsp
      

  5.   

    <html:select property="buyerId" value="<%=UtilFormatOut.checkNull(buyerId)%>">
                          <html:option value="">请选择</html:option>
    <%
    List buyers = (List) request.getAttribute("buyers");
    AuBuyer buyer;
    for (Iterator iter = buyers.iterator(); iter.hasNext();) {
    buyer = (AuBuyer) iter.next();
    %>
      <html:option value="<%=buyer.getBuyerId()%>"><%=buyer.getBuyerName()%></html:option>
    <% }%>
              </html:select>
      

  6.   

    </html:select>你假如是用这中标签,只要 formbean 对应上就可以了。
    如果用的是普通的<select> 你可以在action里把form对象传回jsp,在通过jlst标签<c:if>
    判断值相等就selected