<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>杰克，快跑！ &#187; webwork</title>
	<atom:link href="http://blog.jackrun.com/archives/tag/webwork/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.jackrun.com</link>
	<description>busy to live or busy to die</description>
	<lastBuildDate>Thu, 05 Aug 2010 05:58:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>让WebWork遍历Map</title>
		<link>http://blog.jackrun.com/archives/77.html</link>
		<comments>http://blog.jackrun.com/archives/77.html#comments</comments>
		<pubDate>Tue, 09 Jan 2007 10:38:09 +0000</pubDate>
		<dc:creator>Peltason</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[webwork]]></category>
		<category><![CDATA[遍历Map]]></category>

		<guid isPermaLink="false">http://www.jackrun.com/?p=77</guid>
		<description><![CDATA[用Webwork的标签遍历，是一件很爽的事情。例如遍历一个List。你可以做得比之前任何一套标签更优雅和简单。当遇到Map的时候，可能你会束手无策。因为我也刚好有这样的经历。
如果知道Map里面的Key，使用Key去得到Value那不难做，只需要在遍历的标签里面写上&#60;ww:property value=&#8221;yourMap['key']&#8220;/&#62;即可。但是要把Map里面所有的无素都遍历出来，我查了好多网页都没有答案。最后查了下Webwork in action，发现只有一句话提到Map的遍历，但这句话足以让我找到答案了。原文是：
When iterating over a Map, it
iterates over the Set returned by Map.entrySet(), which is a set of Map.Entry
objects, which in turn has the methods getKey() and getValue() to retrieve the
associated key/value pairs.
译文如下：
当遍历一个Map的时候，它调用Map.entrySet()方法返回一个Set，这个Set是一个Map.Entry对象的集合。这个返回的对象有一个getKey(),getValue()的方法供取得相关的键及值。
发现了有Get方法了。这意味着可以在页面上使用EL直接把Map的键及值取出来了。爽死了。那么，在遍历一个Map的时候，键及值的获得可以这样简单：
&#60;ww:iterator value=&#8221;yourMap&#8221;&#62;
&#60;ww:property value=&#8221;key&#8221;/&#62;&#60;ww:property value=&#8221;value&#8221;/&#62;
&#60;/ww:iterator&#62;
]]></description>
			<content:encoded><![CDATA[<p>用Webwork的标签遍历，是一件很爽的事情。例如遍历一个List。你可以做得比之前任何一套标签更优雅和简单。当遇到Map的时候，可能你会束手无策。因为我也刚好有这样的经历。<br />
如果知道Map里面的Key，使用Key去得到Value那不难做，只需要在遍历的标签里面写上&lt;ww:property value=&#8221;yourMap['key']&#8220;/&gt;即可。但是要把Map里面所有的无素都遍历出来，我查了好多网页都没有答案。最后查了下Webwork in action，发现只有一句话提到Map的遍历，但这句话足以让我找到答案了。原文是：<br />
When iterating over a Map, it<br />
iterates over the Set returned by Map.entrySet(), which is a set of Map.Entry<br />
objects, which in turn has the methods getKey() and getValue() to retrieve the<br />
associated key/value pairs.<br />
译文如下：<br />
当遍历一个Map的时候，它调用Map.entrySet()方法返回一个Set，这个Set是一个Map.Entry对象的集合。这个返回的对象有一个getKey(),getValue()的方法供取得相关的键及值。<br />
发现了有Get方法了。这意味着可以在页面上使用EL直接把Map的键及值取出来了。爽死了。那么，在遍历一个Map的时候，键及值的获得可以这样简单：<br />
&lt;ww:iterator value=&#8221;yourMap&#8221;&gt;<br />
&lt;ww:property value=&#8221;key&#8221;/&gt;&lt;ww:property value=&#8221;value&#8221;/&gt;<br />
&lt;/ww:iterator&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jackrun.com/archives/77.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
