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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:52:56+00:00 2026-05-30T09:52:56+00:00

I want to check if an object is a class and do some formatting

  • 0

I want to check if an object is a class and do some formatting if it is a date. How would I set the if condtion?

<table align="center" class="data_extract vert_scroll_table" >
  <tr>
    <c:forEach var="heading" items="${results.headings}"> 
      <th class="data_extract">${heading}</th>
    </c:forEach>
  </tr>
  <c:forEach var="row" items="${results.data}">
    <tr>
      <c:forEach var="cell" items="${row}" varStatus="rowStatus">
        <td class="data_extract">
          <c:choose>
            <c:when test="${results.types[rowStatus.index].array}">
              <c:set var="comma" value="," />
              <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
                <c:set var="myVar" value="${cellStatus.first ? '' : myVar} ${elem} ${cellStatus.last ? '' : comma}" /> 
              </c:forEach>
              <span class="mouseover_text" title="${myVar}">${myVar}</span>
            </c:when>
            <c:otherwise>
              <c:choose>
                <c:when test="${results.types[rowStatus.index].componentType.class.name eq 'java.sql.Timestamp'}"> 
                  <fmt:formatDate value="${cell}" pattern="${date_pattern}" />
                </c:when>
                <c:otherwise>
                  ${cell}
                </c:otherwise>
              </c:choose>
            </c:otherwise>
          </c:choose>
        </td>
      </c:forEach>
    </tr>
  </c:forEach>
</table>
  • 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-30T09:52:57+00:00Added an answer on May 30, 2026 at 9:52 am

    JSTL will invoke standard setter getters so you can use getClass() and getName() method

    <c:if test="${results.types[rowStatus.index].componentType.class.name 
                  eq 'java.util.Date' }">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Imagepair object is a member variable of some other class.. I want its
I regularly want to check if an object has a member or not. An
I want to check the type of an Object. How can I do that?
I want to check for the existence of a table with a given ID
I want to check in Transact SQL if a specific column in a table
I want to check if a given date is more than a month earlier
I want to run some code before an object is removed from a has_many
Lets say I have 3 classes: class A { void do_A() { //Check object
I want to create an object that acts as a specific class, such as
I need to create an object of some type. The class of the object

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.