jbas
asked on
can experts give me a demo use Pager Tag Library.
hi,experts,
now i down the Pager Tag Library v2.0 in http://jsptags.com/tags/navigation/pager/index.jsp
but i can not use it,can give me a demo?
i hava a java.sql.ResultSet rs.how can i use the Pager Tag Library
<c:set var="sicknessList" value="${idSicknessInfo.ge tSicknessR esult(idSi cknessInfo )}"/>
<c:forEach var="sicknessList" items="${sicknessList}">
<pg:item>
<a href=sicknessInput.jsp?id= ${sickness List.getSt ring("auto id")}>
<tr onmousemove="this.style.ba ckgroundCo lor=onmove color;" onmouseout="this.style.bac kgroundCol or=''">
<td></td>
<td>${sicknessList.getStri ng("Sickne ssName")}< /td>
<td>${sicknessList.getStri ng("Sickne ssPYM")}</ td>
<td>${sicknessList.getStri ng("Sickne ssICD")}</ td>
<td>${sicknessList.getStri ng("Sickne ssMemo")}< /td>
</tr>
</a>
</pg:item>
</c:forEach>
can give me a simple demo with Pager Tag Library
now i down the Pager Tag Library v2.0 in http://jsptags.com/tags/navigation/pager/index.jsp
but i can not use it,can give me a demo?
i hava a java.sql.ResultSet rs.how can i use the Pager Tag Library
<c:set var="sicknessList" value="${idSicknessInfo.ge
<c:forEach var="sicknessList" items="${sicknessList}">
<pg:item>
<a href=sicknessInput.jsp?id=
<tr onmousemove="this.style.ba
<td></td>
<td>${sicknessList.getStri
<td>${sicknessList.getStri
<td>${sicknessList.getStri
<td>${sicknessList.getStri
</tr>
</a>
</pg:item>
</c:forEach>
can give me a simple demo with Pager Tag Library
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi,TimYates
thanks for answer,now i have not get data from rs,this is my code ,where is error!
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn essResult( idSickness Info);
while(rs.next()){
out.println(rs.getString(" sicknessna me")); //can get date!
}
%>
<c:set var="rs" value="${rs}"/>
<c:forEach var="rs" items="${rs.rows}">
<tr><td>${rs.SicknessName} </td></tr> //no data
</c:forEach>
thanks for answer,now i have not get data from rs,this is my code ,where is error!
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn
while(rs.next()){
out.println(rs.getString("
}
%>
<c:set var="rs" value="${rs}"/>
<c:forEach var="rs" items="${rs.rows}">
<tr><td>${rs.SicknessName}
</c:forEach>
I'd load your resultset into an ArrayList...
Depending on how you have your cursor set up,
while(rs.next()){
will move the cursor to the end, thn you won't have any data left for the forEach
Depending on how you have your cursor set up,
while(rs.next()){
will move the cursor to the end, thn you won't have any data left for the forEach
ASKER
sorry,when i remove it ,it can not get data either
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn essResult( idSickness Info);
%>
<c:set var="rs" value="${rs}"/>
<c:forEach var="rs" items="${rs.rows}">
<tr><td>${rs.SicknessName} </td></tr>
</c:forEach>
or
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn essResult( idSickness Info);
%>
<c:set var="rs" value="${rs}"/>
<c:forEach var="rs" items="${rs}">
<tr><td>${rs.getString("Si cknessName ")}</td></ tr>
</c:forEach>
can not get data,why?
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn
%>
<c:set var="rs" value="${rs}"/>
<c:forEach var="rs" items="${rs.rows}">
<tr><td>${rs.SicknessName}
</c:forEach>
or
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn
%>
<c:set var="rs" value="${rs}"/>
<c:forEach var="rs" items="${rs}">
<tr><td>${rs.getString("Si
</c:forEach>
can not get data,why?
<%
java.sql.ResultSet rs=idSicknessInfo.getSickn essResult( idSickness Info);
while( rs.next() )
{
%>
<tr><td><%= rs.getString("SicknessName ") %></td></tr>
<%
}
%>
I don't think the "forEach" tag will call "next()", and iterate smoothly through the result set... I don't really use JSTL, so I may be wrong...
java.sql.ResultSet rs=idSicknessInfo.getSickn
while( rs.next() )
{
%>
<tr><td><%= rs.getString("SicknessName
<%
}
%>
I don't think the "forEach" tag will call "next()", and iterate smoothly through the result set... I don't really use JSTL, so I may be wrong...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks to TimYates and rrz@871311 ,now i can work continue,best regard for you!
There is an example war file, just drop it into tomcat/webapps, and you can look at how it is done for yourself :-)
The pg:index bit is usually loaded in from a seperate jsp file, that means that you can change the style of the pager on the fly :-)
Good luck!
Tim