messagelist
用 messagelist
參數說明
list
start
page
previous
next
MessageListAction 裡的 perform 是這樣寫的
int start = Integer
System
int page =
// create a message list
Message[] list = new Message[
for (int i=
list[i] = new Message(i
}
request
request
request
// if there is a previous page
int previous = start
if ( previous >=
request
System
}
// if there is a next page
int next = start+page;
if ( next< list
request
System
}
return (mapping
下面是 messagelist
< logic:iterate id=
< br >< html:link
paramId=
page=
< bean:write name=
< /html:link >
< /logic:iterate >
< logic:present name=
< br >< html:link
paramId=
page=
上一頁
< /html:link >
< /logic:present >
< logic:present name=
< br >< html:link
paramId=
page=
下一頁
< /html:link >
< /logic:present >
以此例子來說明 logic:iterate 在分頁裡的用法
由於每次 messagelist
比如把 message 數組存放在 session 裡
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28903.html