请教,关于JAVA WEB 分页的问题
有一个页面,提供查询功能,选择书籍的名称,输入书籍名字,点击查询,弹出查询结果窗口,其代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
String p = request.getContextPath();
String name =request.getParameter("queryName");
String value =request.getParameter("queryValue");
String url = "search.action?queryName="+name+"&queryValue="+value+"";
//request.setAttribute("url",url);
%>
<head>
<style type="text/css">
table {
border: 1px solid black;
border-collapse: collapse;
}
table thead tr th {
border: 1px solid black;
padding: 3px;
background-color: #cccccc;
background-color: expression(this.rowIndex % 2 == 0 ? "#FFFFFF" : "#EEEEEE");
}
table tbody tr td {
border: 1px solid black;
padding: 3px;
}
.trs{
background-color: expression(this.rowIndex % 2 == 0 ? "#FFFFFF" : "#EEEEEE");
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<table cellspacing="0" align="center">
<thead>
<tr>
<th>ID</th>
<th>书名</th>
<th>作者</th>
<th>出版社</th>
<th>出版日期</th>
<th>ISNB</th>
<th>页数</th>
<th>价格</th>
<th>内容提要</th>
</tr>
</thead>
<tbody>
<s:iterator value="availableItems">
<tr class="trs">
<td><s:property value="bookId"/></td>
<td><s:property value="bookName"/></td>
<td><s:property value="bookAuthor"/></td>
<td><s:property value="bookPublish"/></td>
<td><s:date name="bookDate" format="yyyy-MM-dd" /></td>
<td><s:property value="bookIsbn" /></td>
<td><s:property value="bookPage" /></td>
<td><s:property value="bookPrice"/></td>
<td> <s:property value="bookContent"/></td>
</tr>
</s:iterator>
<tr align="right">
<td colspan="9">
共<s:property value="totalRows" />行
第<s:property value="currentPage"/>页
共<s:property value="pager.getTotalPages()"/>页
<a href="<s:url value=url>
<s:param name="currentPage" value="currentPage"/>
<s:param name="pagerMethod" value="'first'"/>
</s:url>">首页</a>
<a href="<s:url value=url>
<s:param name="currentPage" value="currentPage"/>
<s:param name="pagerMethod" value="'previous'"/>
</s:url>">上一页</a>
<a href="<s:url value=url>
<s:param name="currentPage" value="currentPage"/>
<s:param name="pagerMethod" value="'next'"/>
</s:url>">下一页</a>
<a href="<s:url value=url>
<s:param name="currentPage" value="currentPage"/>
<s:param name="pagerMethod" value="'last'"/>
</s:url>">尾页</a>
</td>
</tr>
</tbody>
</table>
</body>
</html>
现在问题是<a href="<s:url value=url>中的url获取不到上面的地址,试了几种方式都不可以,请问如何在struts2 标签中引用JAVA变量(不可以的话用什么方式来取)怎么写,谢谢了