日期:2014-05-19 浏览次数:20713 次
<select name="corpId" style="width:155px;"> <option value="" selected>----请选择----</option> <s:iterator value="corpList" id="corp"> <option value=<s:property value="#corp.id"/>><s:property value="#corp.name"/></option> </s:iterator> </select>
private CorpService corpService; private Corp corp; private List<Corp> corpList; public List<NewInsurance> getNewInsuranceList() { System.out.println("// Debug Enter getCorpList:"); corpList = corpService.findAllByFlag(corp); System.out.println("// Debug Enter corpList size = " + corpList.size()); return newInsuranceList; } public void setNewInsuranceList(List<NewInsurance> newInsuranceList) { this.newInsuranceList = newInsuranceList; }
@Table(name="corp") public class Corp { private long id; private String name; private Integer flag; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="corp_id") public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getFlag() { return flag; } public void setFlag(Integer flag) { this.flag = flag; } }
public interface CorpService { public void save(Corp corp); public List<Corp> findAllByFlag(Corp corp); // 保险公司列表只显示新增的保险公司,及新增保险公司可报价 public List<Corp> findAllByNewCorp(); }
<s:action namespace="/itemType" name="findByUserId" id="bean"></s:action> <s:select list="#bean.listItemType" name="item.itemType.id" listKey="id" listValue="name" theme="simple"></s:select>