struts技術的logic標籤- -

開源項目最好的是能夠讓咱們從項目的源碼自己角度看項目,經過對源碼的瞭解更多的是對設計思想融會貫通達提高總體能力的目的。blog也是一個好的項目,能夠讓不從事網頁製做人們也能夠經過簡單的配置實如今網上發佈文章的目的。先前也用struts作過兩個項目,如今只是想從另外一個角度來理解它。天天看了一點兒struts的源碼,記錄下自已的理解。
 
1、定義標籤文件(web.xml)
<taglib>
  <taglib-uri>/tags/struts-logic</taglib-uri>
  <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

2、引用標籤文件(jsp文件)
<%@ taglib uri="/tags/struts-logic" prefix="logic"  %>
 
3、標籤文件說明(struts-logic.tld)
(1)empty標籤
類名:org.apache.struts.taglib.logic.EmptyTag
標籤體:bodycontent=JSP
引用logic:empty
屬性  attribute:name,property,scope
功能:判斷對象的值是否爲空
 
(2)equal
類名:org.apache.struts.taglib.logic.EqualTag
標籤體:bodycontent=JSP
引用logic:equal
屬性  attribute:cookie,header,name,parameter,property,scope,value
功能:等於比較符
 
(3) forward
org.apache.struts.taglib.logic.ForwardTag  
標籤體:bodycontent=empty
引用logic:forward
屬性  attribute:name
功能:頁面導向,查找配置文件的全局forward
 
(4) greaterEqual
類名:org.apache.struts.taglib.logic.GreaterEqualTag
標籤體:bodycontent=JSP
引用logic:greaterEqual
屬性  attribute:cookie,header,name,parameter,property,scope,value
功能:大於等於比較符
 
(5)greaterThan
類名:org.apache.struts.taglib.logic.GreaterThanTag
標籤體:bodycontent=JSP
引用logic:greaterThan
屬性  attribute:cookie,header,name,parameter,property,scope,value
功能:大於比較符
 
(6) iterator
類名:org.apache.struts.taglib.logic.IterateTag
標籤體:bodycontent=JSP
引用logic:iterator
屬性  attribute:collection,id,indexId,length,name,offset,property,scope,type
功能:顯示列表爲collection的值(List ,ArrayList,HashMap等)
 
(7)lessEqual
類名org.apache.struts.taglib.logic.LessEqualTag
標籤體:bodycontent=JSP
logic:lessEqual
屬性  attribute:cookie,header,name,parameter,property,scope,value
功能:小於等於比較符
 
(8)lessThan
類名:org.apache.struts.taglib.logic.LessThanTag
標籤體:bodycontent=JSP
logic:lessThan
屬性  attribute:cookie,header,name,parameter,property,scope,value
功能:小於比較符
 
(9)match
類名:org.apache.struts.taglib.logic.MatchTag
標籤體:bodycontent=JSP
引用logic:match
屬性  attribute:cookie,header,location,name,parameter,property,scope,value
功能:比較對象
 
(10)messagesNotPresent
類名:org.apache.struts.taglib.logic.MessagesNotPresentTag
標籤:bodycontent=JSP
引用logic:messagesNotPresent
屬性  attribute:name,property,message
功能:ActionMessages/ActionErrors對象是否不存在
 
(11)messagePresent
類名:org.apache.struts.taglib.logic.MessagesPresentTag
標籤:bodycontent=JSP
引用logic:messagePresent
屬性  attribute:name,property,message
功能:ActionMessages/ActionErrors對象是否不存在
 
(12)notEmpty
類名:org.apache.struts.taglib.logic.NotEmptyTag
標籤:bodycontent=JSP
引用logic:notEmpty
屬性  attribute:name,property,scope
功能:比較對象是否不爲空

(13)notEqual
類名:org.apache.struts.taglib.logic.NotEqualTag
標籤:bodycontent=JSP
引用logic:notEqual
屬性  attribute:cookie,header,name,parameter,property,scope,value
 
(14)notMatch
類名:org.apache.struts.taglib.logic.NotMatchTag
標籤:bodycontent=JSP
引用logic:notMatch
屬性  attribute:cookie,header,location,name,parameter,property,scope,value
功能:比較對象是否不相等
 
(15)notPresent
類名:org.apache.struts.taglib.logic.NotPresentTag
標籤:bodycontent=JSP
引用logic:notPresent
屬性 attribute:cookie,header,name,parameter,property,role,scope,user
功能:request對象傳遞參數是否不存在
 
(16)present
類名:org.apache.struts.taglib.logic.PresentTag
標籤:bodycontent=JSP
引用logic:present
屬性  attribute:cookie,header,name,parameter,property,role,scope,user
功能:request對象傳遞參數是否存在
 

(17)redirect
類名:org.apache.struts.taglib.logic.RedirectTag
標籤:bodycontent=JSP
引用logic:redirectweb

屬性  attribute:anchor,forward,href,name,page,paramId,paramName,paramProperty,paramScope,property,scope,transaction 功能;頁面轉向,可傳遞參數