struts技術的logic標籤

2021-04-01 10:08:21 字數 3835 閱讀 5460

一、定義標籤檔案(web.xml)

/tags/struts-logic

/web-inf/struts-logic.tld

二、引用標籤檔案(jsp檔案)

<%@ taglib uri="/tags/struts-logic" prefix="logic"  %>

三、標籤檔案說明(struts-logic.tld)

(1)empty標籤

類名:.apache.struts.taglib.logic.emptytag

標籤體:bodycontent=jsp

引用logic:empty

屬性  attribute:name,property,scope

功能:判斷物件的值是否為空

(2)equal

類名:.apache.struts.taglib.logic.equaltag

標籤體:bodycontent=jsp

引用logic:equal

屬性  attribute:cookie,header,name,parameter,property,scope,value

功能:等於比較符

(3) forward

.apache.struts.taglib.logic.forwardtag  

標籤體:bodycontent=empty

引用logic:forward

屬性  attribute:name

功能:頁面導向,查詢配置檔案的全域性forward

(4) greaterequal

類名:.apache.struts.taglib.logic.greaterequaltag

標籤體:bodycontent=jsp

引用logic:greaterequal

屬性  attribute:cookie,header,name,parameter,property,scope,value

功能:大於等於比較符

(5)greaterthan

類名:.apache.struts.taglib.logic.greaterthantag

標籤體:bodycontent=jsp

引用logic:greaterthan

屬性  attribute:cookie,header,name,parameter,property,scope,value

功能:大於比較符

(6) iterator

類名:.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

類名.apache.struts.taglib.logic.lessequaltag

標籤體:bodycontent=jsp

logic:lessequal

屬性  attribute:cookie,header,name,parameter,property,scope,value

功能:小於等於比較符

(8)lessthan

類名:.apache.struts.taglib.logic.lessthantag

標籤體:bodycontent=jsp

logic:lessthan

屬性  attribute:cookie,header,name,parameter,property,scope,value

功能:小於比較符

(9)match

類名:.apache.struts.taglib.logic.matchtag

標籤體:bodycontent=jsp

引用logic:match

屬性  attribute:cookie,header,location,name,parameter,property,scope,value

功能:比較物件

(10)messagesnotpresent

類名:.apache.struts.taglib.logic.messagesnotpresenttag

標籤:bodycontent=jsp

引用logic:messagesnotpresent

屬性  attribute:name,property,message

功能:actionmessages/actionerrors物件是否不存在

(11)messagepresent

類名:.apache.struts.taglib.logic.messagespresenttag

標籤:bodycontent=jsp

引用logic:messagepresent

屬性  attribute:name,property,message

功能:actionmessages/actionerrors物件是否不存在

(12)notempty

類名:.apache.struts.taglib.logic.notemptytag

標籤:bodycontent=jsp

引用logic:notempty

屬性  attribute:name,property,scope

功能:比較物件是否不為空

(13)notequal

類名:.apache.struts.taglib.logic.notequaltag

標籤:bodycontent=jsp

引用logic:notequal

屬性  attribute:cookie,header,name,parameter,property,scope,value

(14)notmatch

類名:.apache.struts.taglib.logic.notmatchtag

標籤:bodycontent=jsp

引用logic:notmatch

屬性  attribute:cookie,header,location,name,parameter,property,scope,value

功能:比較物件是否不相等

(15)notpresent

類名:.apache.struts.taglib.logic.notpresenttag

標籤:bodycontent=jsp

引用logic:notpresent

屬性 attribute:cookie,header,name,parameter,property,role,scope,user

功能:request物件傳遞引數是否不存在

(16)present

類名:.apache.struts.taglib.logic.presenttag

標籤:bodycontent=jsp

引用logic:present

屬性  attribute:cookie,header,name,parameter,property,role,scope,user

功能:request物件傳遞引數是否存在

(17)redirect

類名:.apache.struts.taglib.logic.redirecttag

標籤:bodycontent=jsp

引用logic:redirect

屬性  attribute:anchor,forward,href,name,page,paramid,paramname,paramproperty,paramscope,property,scope,transaction

功能;頁面轉向,可傳遞引數

struts技術的logic標籤

一 定義標籤檔案 web.xml tags struts logic web inf struts logic.tld 二 引用標籤檔案 jsp檔案 taglib uri tags struts logic prefix logic 三 標籤檔案說明 struts logic.tld 1 empty...

struts技術的logic標籤

一 定義標籤檔案 web.xml tags struts logic web inf struts logic.tld 二 引用標籤檔案 jsp檔案 taglib uri tags struts logic prefix logic 三 標籤檔案說明 struts logic.tld 1 empty...

基於Struts2的核心技術

關於struts2的相關問題 1.1.首先當前端進行請求時,這個請求經過一系列的過濾器 filter 接著filterdispatcher被呼叫 filterdispatcher是控制器的核心,就是mvc中c控制層的核心。filterdispatcher的工作原理 1.1.1 filterdispa...

struts1整合ajax技術

1.寫一個繼承actionservlet的類a。在該類a中重寫httpservlet的service方法,然後呼叫actionservlet中的process方法,然後從requst中得到要返回給前臺的值value,如果不為空,則用response.getwriter print value 2.修...

struts2 一些細微技術

1.defaultaction,一般用在請求不存在時,預設跳轉到defaultaction,例如主頁 default.jsp 2.模組包含 3.萬用字元配置 指第幾個 使用這種方法時約定要做得很好,記住一句話,約定優於配置 student success.jsp success.jsp 4.name...