struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vencent Chen" <venc...@gmail.com>
Subject Enum conversion problem
Date Wed, 12 Dec 2007 15:27:12 GMT
Hi,all!
      I am testing the Struts Showcase 2.0.11.
      With the Java 5 Enum conversion, I think the checkboxlist 's list
property  availableOperations just come from OperationsEnumAction's
getAvailableOperations() method. So I change the name availableOperations
to  availableOperation .But it show error:The requested list
selectedOperations key %{availableOperations} could not be resolved as a
collection/array/map/enumeration/iterator type.......
      Ordinary Code:
      public List<OperationEnum> getAvailableOperations() {
        return Arrays.asList(OperationEnum.values());
      }
      <s:checkboxlist label="Operations"
                    name="selectedOperations"
                    list="%{availableOperations}"
                    listKey="name()"
                    listValue="name()"
     />
     Changed:
     public List<OperationEnum> getAvailableOperation() {
        return Arrays.asList(OperationEnum.values());
    }
    <s:checkboxlist label="Operations"
                    name="selectedOperations"
                    list="%{availableOperation}"
                    listKey="name()"
                    listValue="name()"
     />
    It seems so stupid to do so.But at the beginning ,I just can't  find
where the  availableOperations come from.Then I found it into Action
class.So I think this would run correctly.But it doesn't.
    Could any body explain it to me,please?
-- 
Vincent CHen
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message