jsp页面: 
<s:fielderror  fieldName="roleForm.roleFunctionList" id="messageStyle" ></s:fielderror>
  <s:select name="roleForm.roleFunctionList" id='idSelFuncList' multiple="true" cssClass="sel2Side"       
list="funcList" listKey="functionId" listValue="functionName" value="funcList" >
</s:select>
xml:<field name="roleForm.roleFunctionList">
       <field-validator type="fieldexpression">
        <param name="expression">(roleForm.roleFunctionList is not null)</param>
        <message>You must select a function.</message>
      </field-validator>
        </field>这是关于一个function list的验证是否为空的问题。我现在就是roleForm.roleFunctionList总是为空,就算选了也是为空,请教到底应该怎么验证啊,放在客户端验证是可以的,但是因为我上面还有需要服务器端验证的东西,所以为了美观 ,必须要服务器端验证,求高手相助!

解决方案 »

  1.   

    <select name="selectType" id="selectType" style="width: 100px;">
    <s:set name="list" value="tdadataenumlist" id="list"></s:set>
    <s:if test="#list.size>0">
    <s:iterator value="#list" var="lit">
    <option value="<s:property value="ID"/>" typeId="<s:property value="查询"/>">
    <s:property value="显示名"/>
    </option>
    </s:iterator>
    </s:if>
    </select>我的方法 循环list 没数据的话自然为空
      

  2.   

    您好,你的方法怎么验证呢?我不是function list 不能实现,而是不能验证。能不能在不改变jsp的情况下验证呢!