﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-willpower88-文章分类-JAVA FRAMEWORK</title><link>http://www.blogjava.net/willpower88/category/7774.html</link><description>对JAVA有点理解了……</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 12:37:17 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 12:37:17 GMT</pubDate><ttl>60</ttl><item><title>Logic Tags</title><link>http://www.blogjava.net/willpower88/articles/32121.html</link><dc:creator>一凡</dc:creator><author>一凡</author><pubDate>Thu, 23 Feb 2006 08:37:00 GMT</pubDate><guid>http://www.blogjava.net/willpower88/articles/32121.html</guid><wfw:comment>http://www.blogjava.net/willpower88/comments/32121.html</wfw:comment><comments>http://www.blogjava.net/willpower88/articles/32121.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/willpower88/comments/commentRss/32121.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/willpower88/services/trackbacks/32121.html</trackback:ping><description><![CDATA[<STRONG>Logic Tags<BR><BR></STRONG>语法应用是 --<BR>&lt;<I>someComparisonTag</I> <B>value</B>="someUserNameValue" <B>cookie</B>="userName"&gt; (cookie specifies the name of the cookie to compare with value)<BR>&lt;<I>someComparisonTag</I> <B>value</B>="en_US" <B>header</B>="Accept-Language"&gt; (header specifies the name of the HTTP header to compare with value)<BR>&lt;<I>someComparisonTag</I> <B>value</B>="someUserNameValue" <B>parameter</B>="username"&gt; (parameter specifies the name of the request parameter to compare with value)<BR><BR><EQUAL />&lt;<I>someComparisonTag</I> <B>name</B>="testBean" <B>property</B>="propNameInTestBean" <B>value</B>="someValue"&gt; (<B>典型</B>)<BR>name指定了bean的名字而property指定了该bean的某个property以便于与value比较, 通常我们还可以加一个scope来限制bean<BR><EM>property</EM> is used in conjunction with <I>name</I> to specify a property in the bean specified by <I>name</I>.&nbsp;The property reference can be simple, nested, and/or indexed. For the type of syntax used for property, see the users guide on the Bean Tags.<BR><EM><B>scope</B></EM> specifies the bean scope which can be page, request, session, application, "any scope" (default)<BR></EQUAL /><BR>1) 值比较 Value Comparison: equal, notEqual, greaterEqual, lessEqual, lessThan, greaterThan<BR>比较逻辑是 -- 先试图convert成long double,并比较; 如果parse失败就会用String.equalTo()来比较<BR><BR>1) 值比较 Value Comparison: present, notPresent, empty, notEmpty<BR><EQUAL />present看的是某变量/实例是否存在于某个限定范围，empty看的是该实例是否为null, "", or collection.isEmpty()==true (only for collection)<BR><BR>2) 子字符串匹配 Substring Matching: match, notMatch<BR>match/notMatch 还有一个可选location来指定该substring必须出现在字符串开始还是结尾 (location="start/end")<BR><BR>3) Presentation Location: forward, redirect<BR>用法尚不清楚<BR><BR>4) Collection Utilities: iterate (极常用)<BR>&lt;logic:iterate id="searchResultList" name="&lt;%=WebKeys.SEARCH_RESULT_LIST_TWO%&gt;" scope="session"&gt;<BR>&lt;bean:write name="searchResultList" property="itemName"/&gt;&lt;/a&gt;<BR>&lt;bean:write name="searchResultList" property="itemUnitOfMeasure" /&gt;<BR>&lt;bean:write name="searchResultList" property="inventoryDetailSize" format="#0.00"/&gt;<BR>&lt;/logic:iterate&gt;<BR></ITERATE /></ITERATE />如果property给定，name代表了一个bean的实例，而这个bean的getThatProperty()将返回此tag需要的collection实例，<BR>如果没有给定property, name本身就指定了将被iterate的collection的实例，<BR>id给出了每一次循环的collection的当前object的名字，用于在<ITERATE />内部使用<BR>offset和length指定了从collection的哪个位置开始，到哪里结束，其他请参见Struts Documentation，这里不详述<BR><img src ="http://www.blogjava.net/willpower88/aggbug/32121.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/willpower88/" target="_blank">一凡</a> 2006-02-23 16:37 <a href="http://www.blogjava.net/willpower88/articles/32121.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>