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 279453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:02:02+00:00 2026-05-12T05:02:02+00:00

I am using strus2 tags in a jsp to iterate over a collection: <s:if

  • 0

I am using strus2 tags in a jsp to iterate over a collection:

<s:if test="parent.entries.size > 0">
        <table border="3">
            <s:iterator value="parent.entries">
                <tr />
                    <td><s:property value="entry"></td>
                    <td><s:property value="date" ></td>
                </tr>
            </s:iterator>
        </table>
</s:if>

I am having trouble sorting the result by examining the time stamp (date/time) provided by the second column (date). The underlying action is exposing mySet, which is unsorted and the timestamp value for the second column is automatically generated for every new insert.

The objective is to simply sort the rows with the last record on top. I am not executing an explicit select statement on the database, rather than the parent entity of mySet is retrieved.

Is there a recommended way to sort this collection on the jsp (action result) level using struts2 tags and the timestamp value?

Thanks for any advice.
Kind regards

  • 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-05-12T05:02:02+00:00Added an answer on May 12, 2026 at 5:02 am

    If you are using struts 2 probably you want to take a look to the display tag, with this tag your table will look something like this:

    <display:table defaultsort="1" id="yourListIdentifier" name="yourListIdentifier" pagesize="10" requestURI="/yourAction" sort="list">
        <display:column property="entry" title="entry"/>
        <display:column property="date" title="date" sortable="true" defaultorder="ascending"/>
    </display:table>
    

    And another way of doing it is that you could probably code some javascript that sort the table on the client side.

    Hope this helps.

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

Sidebar

Related Questions

I'm using Java at the core backend and JSP pages as GUI frontend. and
I'm using Java+struts2+JSP as the web application framework. I have to pass some huge
Using SVN you can right click a folder TEST and add it to the
I have a tree generated with JSTree in my JSP page (part of a
I am using struts2 (2.1.6) and want to redirect to Action2 from Action1 .
Using PHP, I'm trying to give each specific text its own variable. I believe
I have a UL that contains items that the user can click on and
How to gzip an ajax response with Struts2? I tried to create a filter
I'm having an issue sending array parameters to a Struts 2 action class. I
Hey I've encountered an issue where my program stops iterating through the file at

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.