I have an action that returns a hash map that I need to output both the key
and value, but I can't figure out how to access each property with
s:iterate.  Any suggestions would help.

The HashMap is being set in my action and returned populated (verified with
<s:debug/>).

// Action snippet
Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator();
Map tempMap                       = new HashMap();
tempMap                              = new TreeMap();

      while (categoryPhysPropsItr.hasNext()) {
        DruglistDrugproperty prop = new DruglistDrugproperty();
        prop = (DruglistDrugproperty) categoryPhysPropsItr.next();

        tempMap.put(prop.getDruglistDrugclass().getDrugClassName(),
prop.getDrugService());

      }

      setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated
through
// end Action Snippet

// Display JSP
<s:iterator value="drugClassPropsSrvc" status="status">
    Key (<s:property
value="%{drugClassPropsSrvc['+#status.index+'].value}/>")<br/>
    Value (<s:property
value="%{drugClassPropsSrvc['+#status.index+'].value}"/>) <br/>
</s:iterator>

// end Display JSP

Thanks,
Cory

Reply via email to