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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:18:42+00:00 2026-06-11T23:18:42+00:00

Consider the following where availableExclusions is an array of Date objects. <s:select listValue=(new java.text.SimpleDateFormat(‘MM/dd/yyyy’)).format(new

  • 0

Consider the following where availableExclusions is an array of Date objects.

<s:select listValue="(new java.text.SimpleDateFormat('MM/dd/yyyy')).format(new java.util.Date(#this[0].time))" size="25" id="inputExclusionDates" name="available" list="availableExclusions" multiple="true" cssClass="multi-select" />

I created the above in response to this question How would I format a list of dates within a struts 2 select tag? (and I also recommended that the other solution may be the better way to go). Regardless if using such long OGNL expression is a good idea or not, I can’t see the need for: new java.util.Date(#this[0].time) despite creating that fragment out of frustration and to my surprise found it worked where the seemingly equivalent #this[0] did not (produced no output).

If we substitute in listValue="#this[0].class" we see what we would expect: class java.util.Date

Creating a new Date behaves as expected, and calling the deprecated properties of Date such as listValue="#this[0].day" produces the expected output.

Why must I use the redundant expression new java.util.Date(#this[0].time) instead of #this[0] in this select statement?

Using Struts 2.3.1.2

  • 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-11T23:18:44+00:00Added an answer on June 11, 2026 at 11:18 pm

    Because #this[0] is automatically converted to String. If you turn log level to debug you can see an exception message that’s normally suppressed.

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

Sidebar

Related Questions

Consider following: Partial View: <%= Html.ListBox(BlackList, Model.Select( x => new SelectListItem { Text =
Consider following text: $content=<<<EOT { translatorID: f4a5876a-3e53-40e2-9032-d99a30d7a6fc, label: ACL, creator: Nathan Schneider, target: ^https?://(www[.])?aclweb\\.org/anthology-new/[^#]+,
Consider following tables in MySQL database: entries: creator_id INT entry TEXT is_expired BOOL other:
Consider following text file: something something something = someother thing other thing = third
Consider following tables and java classes to phrase the problem for which I seeking
Let's consider following html code: <p> Some text followed by <span>a span element</span> and
Consider following code: ArrayList<Integer> aList = new ArrayList<Integer>(); aList.add(2134); aList.add(3423); aList.add(4234); aList.add(343); String tmpString
Consider following code: char str[] = Hello\0; What is the length of str array,
Consider following assumptions: I have Java 5.0 Web Application for which I'm considering to
Lets consider following two codes First: for (int i=0;i<10000000;i++) { char* tab = new

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.