<form action="/system/product.action" name="searchForm">
<img src="/Images/icon_search.gif" width="26" height="22" border="0" alt="search" />
<!-- 分类 -->
分类: <s:select name="query.dir_id" list="#dirs" listKey="id" listValue="name" headerKey="-1" headerValue="---请选择---">
</s:select>
<!-- 品牌 -->
<!-- 最低价 -->
最低价:<s:textfield name="query.minSalePrice"></s:textfield> 最高价:<s:textfield name="query.SalePrice"></s:textfield>
<!-- 上架 -->
<s:radio name="query.status" list="#{0:'下架',1:'上架' }"></s:radio>
<!-- 关键字 -->
关键字 <input type="text" name="keyword" size="15" />
<input type="submit" value=" 搜索 " class="button" />
</form>
<!-- 分页开始 -->
<table id="page-table" cellspacing="0">
<tr>
 
</tr>
<tr>
<td width="80%"> </td>
<td align="center" nowrap="true">
<a href="/system/product?query.currentPage=1 ">首页</a> 
<a href='/system/product?query.currentPage= <s:property value="#pageResult.prevPage"/> '>上一页</a> |
<a href='/system/product?query.currentPage= <s:property value="#pageResult.nextPage"/> '>下一页</a> 
<a href='/system/product?query.currentPage= <s:property value="#pageResult.totalPage"/> '>尾页</a> 
当前<s:property value="#pageResult.currentPage"/>页/
总共<s:property value="#pageResult.totalPage"/>页 
总共<s:property value="#pageResult.totalData"/> 条数据 
<s:property value="#pageResult.nextPage"/>
</td>
</tr>
<tr>  </tr>
</table>
<!-- 分页结束 -->
Aciton代码行
public class ProductAction extends ActionSupport{
IProductDAO dao=new ProductDAOImpl();
Product product=new Product();
IProductDirDAO dirDAO=new ProductDriDAOImpl();
ProductQuery query=new ProductQuery();
/**
* 用于显示清单页面的数据跳转
*/
@Override
public String execute() throws Exception {
ActionContext.getContext().put("dirs", dirDAO.findAll());
ActionContext.getContext().put("pageResult", dao.pageQueryAll(query));
return SUCCESS;
}
/**
* 用于增删改的跳转
*/
public String input(){
//不为null代表是修改
if(product.getId()!=null){
product = dao.find(product.getId());
ActionContext.getContext().put("product", product);
}
ActionContext.getContext().put("dirs", dirDAO.findAll());
return "input";
}
public String edit(){
System.out.println(product.getId());
if(product.getId()!=null){
dao.update(product);
}else{
//这个浏览次与录入时间应该写在里面(修改的时候不修改它们)
product.setViewTimes(0);
product.setInputTime(new Date());
dao.save(product);
}
return "edit";
}
/*
* 删除的方法
*/
public String delete(){
dao.delete(product.getId());
return "delete";
}
public Product getProduct() {
return product;
}
public ProductQuery getQuery() {
return query;
}
从前台到后台都都检查了没发现错误,就是点击下一页出现错误.错误提示#dirs这儿我感觉可能有问题,但是真的不知道处在哪儿?