---
title: "Struts2 doubleselect标签的使用"
author: "penua"
date: "2008-12-22T10:08:22Z"
tags: []
categories: ["企业架构"]
slug: "struts2-doubleselect"
draft: false
lastmod: "2008-12-22T10:08:22Z"
id: 298641
url: "https://pinghua.iteye.com/blog/298641"
---

可能很多人在使用Struts2 doubleselect 都碰到第二个标签为空的问题,解决办法是:

- 第一个List不能直接使用LinkedHashMap类型的对象,而要使用对应的#xxMap.values()(别忘记后面的括号),或者定义一个list,原因是这个list必须支持iterator接口,而LinkedHashMap之类不支持iterator,导致无法根据top对象得到第二个list

- 第二个List使用可使用一个map<String,Object>,不过最好还是先用<s:set .../>标签把map放到一个变量中

- 不要忘记用 # 符号


通过上面的方法可以得到想要的doubleSelect :)