<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false"%>   
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>   
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %><%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">   
<html>   
<head>
<base href="<%=basePath%>">
    
    <title>产品分类列表</title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>   
<body>   
<pg:pager url="back/sysProducttype.do?method=showProducttype" index="half-full" maxPageItems = "10" 
maxIndexPages="10"  isOffset = "${false}" export = "currentPageNumber=pageNumber"  scope = "request">      
 <table>     
    <c:forEach items="${producttype}" var="producttype">   
    <pg:item>   
     <tr>   
      <td height="39">${producttype.id}</td>   
      <td height="39">${producttype.name}</td>     
     </tr>        
    </pg:item>   
</c:forEach>   
</table>     
<pg:index>
<pg:first unless="current"><a href="${pageUrl}" class="f14">首页</a></pg:first>
<pg:prev export="firstItem,pageUrl"><a href="${pageUrl}" class="f14">上一页</a></pg:prev>
<pg:pages export="pageNumber,firstItem,pageUrl">
<c:choose>
<c:when test="${pageNumber == currentPageNumber}">
<span class="current">${pageNumber}</span>
</c:when>
<c:otherwise><a href="${pageUrl}">${pageNumber}</a>
</c:otherwise>
</c:choose>
</pg:pages>
<pg:next export="firstItem,pageUrl"><a href="${pageUrl}" class="f14">下一页</a></pg:next>
<pg:last unless="current"><a href="${pageUrl}" class="f14">末页</a></pg:last>
<pg:page export="first,last">第${first}- ${last}条</pg:page> 
</pg:index> 
</pg:pager> 
</body>
</html> 点下页是出现路径:http://localhost:8080/Shop/back/sysProducttype.do?method=showProducttype?paper.offset=10
我不想显示?paper.offset=10
在线等……

解决方案 »

  1.   

    我不想显示?paper.offset=10 
    <from method="get">默认是get就会出来你可以改成
    method="post"
      

  2.   


    你是说的:
    点下页是出现路径:http://localhost:8080/Shop/back/sysProducttype.do?method=showProducttype?paper.offset=10 
    我不想显示?paper.offset=10 这个显示很好,为什么要改啊
    baidu,google的分页都带啊.
    如果想改可以考虑用:urlWrite或自己写过滤器.
      

  3.   

    这么Form表单应该加在什么位置?
      

  4.   

    method=showProducttype?paper.offset=10
    在dispatchAction中不能识别这个方法啊
      

  5.   

    怎么可能呢,不是明明指明了showProducttype这个方法了吗?我看倒是后面的那个参数有问题,哪个变量名用paper.offset呢?
      

  6.   

    我也纳闷啊……就是因为?pape.offset
      

  7.   


    request.getParameter("page.offset");得不到啊?
    是不是自定义标签哪不对啊.报错吗?
      

  8.   


    才发现,接的第二个参数不是&
    自定义标签的问题吧!
      

  9.   


    struts-config.xml
    配置指定了method=showProducttype没.
      

  10.   

    方法肯定是没问题……有问题的话显示第一页就会提示错误的……在跳转的时候,路径后面出现了?paper.offset=10
      

  11.   

    <pg:XX>标签没用过啊.指能到网上找找资料了,看看这个,希望有帮助:
    http://www.blogjava.net/jacky/archive/2007/02/05/98123.html
      

  12.   

    改成:
    method=showProducttype&amp;offset=10试试!
      

  13.   

    用href 方式就会有路径,除非用 post 提交方式,这样就不会有了,
    可以用:
    a=10;
    b=4;
    form1.submit();
    的方式
      

  14.   

    method=showProducttype?paper.offset=10 后面的路径是自动生成的……我也想把改声&,但是不知道在哪里改啊……