You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "A. Lotfi" <ma...@yahoo.com> on 2006/07/06 20:31:15 UTC

How to use jsptags for pagination in struts ??

Hi , I am trying to use pagination in struts , but when I put the tag in my jsp page , the page is blanck : here is my jsp page :
   
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  <%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg" %>
   
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/coeus-utils.tld" prefix="util" %>
  <%@ include file= "/coeuslite/mit/utils/CoeusContextPath.jsp"  %>
<jsp:useBean  id="inboxList" scope="session" class="java.util.Vector"/>
<bean:size id="inboxListSize" name="inboxList"/>
  <html:html>
    <head>
        <title>Coeus Web</title>
        <html:base/>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link href="<bean:write name='ctxtPath'/>/coeuslite/mit/utils/css/coeus_styles.css" rel="stylesheet" type="text/css">
    </head>
    
    <body>
           
    <html:form action="/updateInboxMessages.do?messageType=unresolved" method="POST">
        <a name="top"></a>
  <table width="980" height="100%"  border="0" cellpadding="0" cellspacing="0" class="table">
    <%String messageType = request.getParameter("messageType"); %>
    <!-- EntityDetails - Start  -->
    <tr>
      <td height="119" align="left" valign="top"><table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0" class="tabtable">
          <tr>
            <td colspan="4" align="left" valign="top"><table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0" class="tableheader">
                <tr>
                  <td> <bean:message bundle="coi" key="unresolvedMsgs.header"/>    </td>
                </tr>
            </table></td>
          </tr>
            
          
                        <logic:equal name="inboxListSize" value="0">
                            <tr>
                                <td>
                                    <table width="95%" align="right" border="0">
                                        <tr>
                                            <td>
                                                <b> <bean:message bundle="coi" key="unresolvedMsgs.noMessages"/>    
                                                <!--bean:write name="userInfoBean" property="userName" /--></b>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                         
                        </logic:equal>     
                    
                    
                        <logic:notEqual name="inboxListSize" value="0" >
                    
                            <tr>
                                    <td class="copy">
                                        <html:submit property="save" value="Move Selected Messages"  styleClass="clbutton" />   
                                    </td>
                            </tr>
                            <tr class='copybold' align="left">
                                <td>
                                    <font color="red"  >
                                        <html:messages id="message" message="true" bundle="coi">
                                            <bean:write name = "message" />
                                        </html:messages>
                                    </font>
                                </td>  
                            </tr>
                    
                        <tr align="center">
                        <td colspan="3"><br>
                            <DIV STYLE="overflow: auto; width: 955px; padding:0px; margin: 0px">
                       
                                <table width="96%"  border="0" cellpadding="0" class="tabtable">
                              
                                
                                        <tr>
                                            <td width="5%" align="left" class="theader">&nbsp;<img src="<bean:write name='ctxtPath'/>/coeuslite images/checked.gif" border="0"/></td>
                                            <td width="5%" align="left" class="theader"><html:link page="/getInboxMessages.do?messageType=unresolved" anchor="legend">
                                                <img src="<bean:write name='ctxtPath'/>/coeuslite images/gflag.gif">
                                            </html:link>
                                            </td>
                                                                                       
                                             <td width="10%" align="left" class="theader"> <bean:message bundle="coi" key="label.from"/>  </td>
                                             <td width="15%" align="left" class="theader">  <bean:message bundle="coi" key="label.message"/>  </td>
                                             <td width="20%" align="left" class="theader"> <bean:message bundle="coi" key="label.proposalTitle"/>  </td>
                                             <td width="20%" align="left" class="theader"> <bean:message bundle="coi" key="label.proposalNumber"/>  </td>
                                             <td width="15%" align="left" class="theader"> <bean:message bundle="coi" key="label.dateReceived"/> </td>
                                        </tr>
                                            <% int count =0; %>    
                                             <%  int disclIndex = 0;
                                                     String strBgColor = "#DCE5F1";
                                                      %>
                                                    
      <pg:prev export="pageUrl" ifnull="<%= true %>">
  <% if (pageUrl != null) { %>
    <td align=right><A HREF="<%= pageUrl %>"><IMG
      SRC=http://www.google.com/nav_previous.gif alt="" border=0><br>
    <b>Previous</b></A></td>
  <% } else { %>
    <td><IMG SRC=http://www.google.com/nav_first.gif alt="" border=0></td>
  <% } %>
</pg:prev>
<pg:pages>
                                              
                                                    
                                                    
                                                    
                                                    
                                            <logic:iterate id="inbox" scope="session" name="inboxList" type="org.apache.commons.beanutils.DynaBean" indexId="ctr">
                                                <%
                                                        Integer countInt = new Integer(count);
                                                        String countString = countInt.toString();
                                                %>
                                                    <%                                  
                                                           if (disclIndex%2 == 0) {
                                                                strBgColor = "#D6DCE5"; 
                                                            }
                                                           else { 
                                                                strBgColor="#DCE5F1"; 
                                                             }
                                                        %>
                            
                                             <tr valign='top' bgcolor='<%=strBgColor%>' onmouseover="className='TableItemOn'" onmouseout="className='TableItemOff'">
                                                        <td> 
                                                            <html:multibox property="whichMessagesAreChecked">
                                                            <%= countInt %>
                                                            </html:multibox>
                                                        </td>
                                                        <td width='5%'>
                                                            <logic:notEqual name="inbox" property="daysUntilDeadline" value="-1">
                                                                <logic:greaterEqual name="inbox" property="daysUntilDeadline" value="0" >
                                                                <logic:lessThan name="inbox" property="daysUntilDeadline" value="3" >
                                                                    <img src="<bean:write name='ctxtPath'/>/coeuslite images/rflag.gif" border="0"/> 
                                                                </logic:lessThan>
                                                                <logic:greaterEqual name="inbox"
                                                                property="daysUntilDeadline"
                                                                value="3" >
                                                                <logic:lessThan name="inbox"
                                                                    property="daysUntilDeadline"
                                                                    value="5" >                                                                      
                                                                    <img src="<bean:write name='ctxtPath'/>/coeuslite images/yflag.gif" border="0"/>
                                                                </logic:lessThan>
                                                                <logic:greaterEqual name="inbox"
                                                                    property="daysUntilDeadline"
                                                                    value="5" >
                                                                    <logic:lessThan name="inbox"
                                                                        property="daysUntilDeadline"
                                                                        value="11" >
                                                                        <img src="<bean:write name='ctxtPath'/>/coeuslite images/gflag.gif" border="0"/>
                                                                    </logic:lessThan>
                                                                </logic:greaterEqual>
                                                                </logic:greaterEqual>
                                                                </logic:greaterEqual>
                                                            </logic:notEqual>
                                                          </td>
                                                          <td class='copy'> <%=inbox.get("fromUser")%></td>   
                                                          <td class="copy">
                                                         <%=inbox.get("message")%>
                                                        </td>
                                                        <td class='copy'>
                                                            <u> 
                                                            <html:link  action="/displayProposal.do" paramName="inbox" paramProperty="moduleItemKey" paramId="proposalNo"> <%=inbox.get("proposalTitle")%> </html:link>
                                                            </u> 
                                                        </td>
                                                        <td align="justify" class="copy"> 
                                                            <u>
                                                            <html:link  action="/displayProposal.do" paramName="inbox" paramProperty="moduleItemKey" paramId="proposalNo">  <%=inbox.get("moduleItemKey")%> </html:link>
                                                            </u>
                                                        </td>                 
                                                        <td class="copy">   
                                                        <%=inbox.get("arrivalDate")%>                                  
                                                        </td>
                                                        <input type="hidden" name='hdnMessageId' value='<%=inbox.get("messageId")%>'>
                                                </tr> 
                                                 <% disclIndex++ ;%>
                                               <% count++; %>
                                            </logic:iterate>
                                            
             </pg:pages>
<pg:next export="pageUrl" ifnull="<%= true %>">
  <% if (pageUrl != null) { %>
    <td><A HREF="<%= pageUrl %>"><IMG
      SRC=http://www.google.com/nav_next.gif alt="" border=0><br>
    <b>Next</b></A></td>
  <% } else { %>
    <td><IMG SRC=http://www.google.com/nav_last.gif alt="" border=0></td>
  <% } %>
</pg:next>
                               
                        
                       
                                </table>
                         
                            </DIV>
                        </td>
                        </tr> 
      
                        <tr>
                            <td>
                                <table table width="95%" border="0" cellpadding="5" cellspacing="0" width="100%" align="center" class='theader'>
                                <a name="legend"></a>
                                <tr>
                                    <td width="10%" class='copy' align="left"><b> <bean:message bundle="coi" key="label.legend"/> </b>
                                    </td>
                                    <td width="20%" class='copy' align="left" >
                                        <img src="<bean:write name='ctxtPath'/>/coeuslite images/gflag.gif">
                                         <bean:message bundle="coi" key="label.deadline10days"/>   
                                    </td>
                                    <td width="20%" class='copy' align="left">
                                        <img src="<bean:write name='ctxtPath'/>/coeuslite images/yflag.gif" border="0" />
                                          <bean:message bundle="coi" key="label.deadline4days"/> 
                                    </td>
                                    <td width="20%" class='copy' align="left">
                                        <img src="<bean:write name='ctxtPath'/>/coeuslite images/rflag.gif" border="0" />
                                         <bean:message bundle="coi" key="label.deadline2days"/> 
                                    </td>
                                </tr>
                                    
                                </table>
                            </td>
                        </tr>
                         <tr>
                              <td>
                                  &nbsp;
                              </td>
                          </tr>    
                        <tr>
                            <td class="copy">
                                <html:submit property="save" value="Move Selected Messages"  styleClass="clbutton" />   
                            </td>
                          </tr>
                    
                        </logic:notEqual>
            
              <tr>
                  <td>
                      &nbsp;
                  </td>
              </tr>                        
          </table>
      </td>
  </tr>
        <tr>
          <td height='10'>
              &nbsp;
          </td>
      </tr>      
   
</table>
  
    </html:form> 
    </body>
</html:html>
   
   
   
  Thank you, your help is appreciated.
   

 		
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.