Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8167911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:21:15+00:00 2026-06-06T20:21:15+00:00

I am new to do this sorting technique in jsp page of dynamic content.

  • 0

I am new to do this sorting technique in jsp page of dynamic content. My application is integrated with struts2+jsp+hibenate. I am using the following code in jsp.

report.jsp

          <table class="report_view_table" id="results">
    <thead>
        <tr> <th width="35" scope="col" abbr="no">No
            </td>
            <th width="50" scope="col" abbr="status">Date
            </td>
            <th width="80" scope="col" abbr="option">productName
            </td> 
        </tr>
    </thead>
    <tbody>
  <s:if test="resultList.size() > 0">
  <s:if test="productName.size() > 0">
  <s:iterator status="rowNo" value="resultList">
      <s:set name="Result_product" value="%{productId}" />
  <tr> <td><span class="check"><s:property value="%{#rowNo.count}" /></span></td>
       <td><span class="check"><s:property value="%{proDate}" /></span></td>
       <td><span class="check"><s:iterator value="productName"> 
           <s:set name="product"value="%{productId}" /> 
           <s:if test="%{#product== #Result_product}">
        <s:property value="%{productionName}" /> </s:if></s:iterator>
       </span></td>
   </tr>
   </s:iterator>
   </s:if>
   </s:if>
   <s:else>No report is available
   </s:else>
    <s:else>No report is available
   </s:else>
       </tbody>
   </table>

Here, i want to sort the table by its column heading. how to sort this dynamic content of table. Anybody please help me to do this functionality. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:21:17+00:00Added an answer on June 6, 2026 at 8:21 pm

    Client side sorting : use jquery dataTable

    for using jquery datatable specify the id of you table to the jquery datatable.
    e.g. results is the id of your table

    add javascript file for the jquery and jquery datatable

    $(document).ready(function(){
        $('#results').dataTable();
    });
    

    Server Side sorting : sort you list resultList on server side using Arrays.sort() by help of interface Comparable refer http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code for sorting. Can this be improved? import java.util.*; class
myListBox.Items.SortDescriptions.Add( new SortDescription(BoolProperty, ListSortDirection.Descending)); This sorting works only for string properties of the underlying
(I am pretty new to all this.) I have a page where the user
this is the question Shuffle. Now that you’ve finished your new sorting algorithm, how
I am new this sharepoint development and i have task in hand to do
new to this site so sorry if this question is inappropriate, or in the
New to this library (no more familiar with BeautifulSoup either, sadly), trying to do
Im new to this.I have a cron file called xml.php and i want to
Why does this: (new[]{1,2,3}).Cast<decimal>(); result in an InvalidCastException: Specified cast is not valid.
Im new on this project and am going to write, what i thought was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.