piao_liu 2009-09-05 15:12
浏览 238
已采纳

关于struts2的s:if标签问题

package com.shop.bean;

import java.util.List;

public class PageView {

private int currentPage = 1;

private long totalPage = 1;

private long totalRecord = 1;

private List records;

private int firstIndex = 1;

private PageIndex pageIndex;

private int maxResult = 12;

public PageView(int currentPage, int maxResult) {
this.currentPage = currentPage;
this.maxResult = maxResult;
this.firstIndex = currentPage * maxResult;
}

public int getCurrentPage() {
return currentPage;
}

public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}

public void setQueryResult(QueryResult qr){
setTotalRecord(qr.getTotal());
setRecords(qr.getDatas());
}

public long getTotalPage() {
return totalPage;
}

public void setTotalPage(long totalPage) {
this.totalPage = totalPage;
this.pageIndex = WebTool.getPageIndex(this.maxResult, this.currentPage, this.totalPage);
}

public long getTotalRecord() {
return totalRecord;
}

public void setTotalRecord(long totalRecord) {
this.totalRecord = totalRecord;
setTotalPage(totalRecord / this.maxResult == 0 ? totalRecord / this.maxResult : totalRecord / this.maxResult + 1);
}

public List getRecords() {
return records;
}

public void setRecords(List records) {
this.records = records;
}

public int getFirstIndex() {
return firstIndex;
}
public PageIndex getPageIndex() {
return pageIndex;
}

public void setPageIndex(PageIndex pageIndex) {
this.pageIndex = pageIndex;
}

public int getMaxResult() {
return maxResult;
}

public void setMaxResult(int maxResult) {
this.maxResult = maxResult;
}

public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
}

画面的代码:

第 页 /s:if
/s:if
/s:iterator

action中的代码:
Map request = (Map )ActionContext.getContext().get("request");
request.put("pageView", pageView);

中="#request.pageView.pageIndex.pageList值能正常获取,可是 中的="#request.pageView.currentPage值获取不到正确的值,这是什么原因啊?
[b]问题补充:[/b]

第页/s:if
/s:if
/s:iterator

运行之后运行结果是两个条件语句都运行。这是怎么回事?

  • 写回答

2条回答 默认 最新

  • iteye_10013 2009-09-05 15:23
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了