title: DisplayTag in Struts2 for pagination
body: <p>I want to apply pagination to my struts2 web application. When the user logs in,  I am redirecting them to the home page, on which I want to display all the users in pagination using the <code>display</code> tag. </p>
  
  <p>I've done research and finally integrated this in my struts2, but when I run the code after login it displays the message <code>Nothing found to display</code>. </p>
  
  <p>When I've done the same thing in struts1.3 by taking example from <a href="http://www.vaannila.com/struts/struts-example/struts-pagination-example-1.html" rel="nofollow">this site</a> it is working. 
  I have copied the following JAR files to my <code>lib</code> folder:</p>
  
  <pre><code>commons-logging.jar
  commons-lang.jar
  commons-collections.jar
  commons-beanutils.jar
  displaytag-1.2.jar
  </code></pre>
  
  <p>I have also copied <code>displaytag.tld</code> and <code>struts-2.17.dtd</code> to my <code>web-inf</code> folder.</p>
  
  <p>Below is my code:</p>
  
  <p>my profile.jsp</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;%@taglib uri="http://displaytag.sf.net" prefix="display" %&gt;
  &lt;%@taglib uri="/struts-tags"  prefix="s" %&gt;
  &lt;html&gt;
     &lt;head&gt;
     &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="wrapper"&gt;
          &lt;div id="steps"&gt;
              &lt;fieldset class="step"&gt;
                  &lt;legend&gt;Profile
                      &lt;/legend&gt;
                  &lt;display:table id="data" name="list" requestURI="/display.action" pagesize="1" &gt;
                      &lt;display:column sortable="true"&gt;
                          &lt;p&gt;
                              &lt;label for="username"&gt;User Name&lt;/label&gt;
                              &lt;input id="username" name="username" value="&lt;s:property value="firstName" /&gt;" disabled="disabled"/&gt;
                          &lt;/p&gt;
                          &lt;p&gt;
                              &lt;label for="email"&gt;Father Name&lt;/label&gt;
                              &lt;input id="email" name="email" value="&lt;s:property value="lastName"/&gt;" disabled="disabled" /&gt;
                          &lt;/p&gt;
                          &lt;p&gt;
                              &lt;label for="password"&gt;Age&lt;/label&gt;
                              &lt;input  name="password" value="&lt;s:property value="dob"/&gt;" disabled="disabled"/&gt;
                          &lt;/p&gt;
                          &lt;p&gt;
                              &lt;label for="address"&gt;Address&lt;/label&gt;
                              &lt;input name="address"  value="&lt;s:property value="emailID"/&gt;" disabled="disabled"/&gt;
                          &lt;/p&gt;
                  &lt;/fieldset&gt;
                      &lt;/div&gt;
                  &lt;/display:column&gt;
              &lt;/display:table&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Struts.xml</p>
  
  <pre><code>&lt;action name="display" class="com.java.action.SearchAction"&gt;
          &lt;result name="success"&gt;/profile.jsp&lt;/result&gt;
          &lt;result name="errror"&gt;/error.jsp&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>SearchAction.java</p>
  
  <pre><code>private ArrayList&lt;UserBean&gt; list=new ArrayList&lt;UserBean&gt;();
  //setter getter 
  public String execute()
  {
      UserBean rt=new UserBean();
      SearchDB user=new SearchDB();
      this.setList(user.search(gender,age_min,age_max,religion,caste,photo_display));
      return SUCCESS;
  }
  </code></pre>
  
  <p>UserBean.java</p>
  
  <pre><code>public class UserBean {
  
  private String emailID;
  private String userName;
  private String gender;
  private String dob;
  private String firstName;
  private String lastName;
  private int Id;
  //setter and getter
  }
  </code></pre>
  
  <p>SearchDB.java</p>
  
  <pre><code>//code to get records. their is no problem here because it is taking records out from db fine.
  </code></pre>
  
  <p>I am not sure, but my guess is <code>requestURI</code> and name attribute in <code>displaytag</code> because in the example linked above, they are using <code>name="sessionScope.UserForm.userList"</code>. Would someone please tell me where I did wrong? </p>