title: Sorting the result being displayed without merging the two arrays
body: <p>I have two arrays as follows in my form and I am displaying the values of the arrays to the user using jsp. </p>
  
  <pre><code>Trip[] tripArray = new Trip[];
  Route[] routeArray = new Route[];
  
  
  Trip Class: 
  public class Trip{
      private String name; 
      private String address; 
      private String job; 
  }
  
  Route class: 
  public class Route{
      private String myName; 
      private String myAddress;
      private String myJob; 
  }
  </code></pre>
  
  <p>My jsp file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;logic: notEmpty name="myForm" property="tripArray"&gt;
  &lt;logic:iterate id="data" name="myForm" property="tripArray" type="com.example.Trip"&gt;
      &lt;td&gt;&lt;bean:write name="data" property="name" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;bean:write name="data" property="address"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;bean:write name="data" property="job"/&gt;&lt;/td&gt;
  &lt;/logic:iterate&gt;
  &lt;/logic:notEmtpty&gt;
  
  &lt;logic: notEmpty name="myForm" property="routeArray"&gt;
  &lt;logic:iterate id="data" name="myForm" property="routeArray" type="com.example.Route"&gt;
      &lt;td&gt;&lt;bean:write name="data" property="myName" /&gt;&lt;/td&gt;
      &lt;td&gt;&lt;bean:write name="data" property="myAddress"/&gt;&lt;/td&gt;
      &lt;td&gt;&lt;bean:write name="data" property="myJob"/&gt;&lt;/td&gt;
  &lt;/logic:iterate&gt;
  &lt;/logic:notEmtpty&gt;
  </code></pre>
  
  <p>I want to able to sort the results thats' being displayed. Since I have two arrays, I can merge the two arrays, sort it and display the results using the new merged array. </p>
  
  <p>But this would require me to change my jsp file as well. And I believe it's just too much work than necessary doing it this way. </p>
  
  <p>Is there another way to do this without having to change my jsp file and without merging the arrays? </p>