Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3424

The new timezone date tag attribute is not evaluating OGNL expressions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.1
    • Component/s: Other
    • Labels:
      None
    • Environment:

      any

    • Flags:
      Patch

      Description

      If you fill the timezone attribute of the date tag with an OGNL expression, is not being evaluated at all, fact that makes the attribute almost useless.

      Here is a patch to fix it:

      — - 2010-03-30 23:33:27.000000000 +0200
      +++ src/core/src/main/java/org/apache/struts2/components/Date.java 2010-03-30 23:28:20.000000000 +0200
      @@ -304,6 +304,9 @@
      } else {
      TimeZone tz = TimeZone.getDefault();
      if (timezone != null)

      { + timezone = stripExpressionIfAltSyntax(timezone); + String actualTimezone = (String) getStack().findValue(timezone, String.class); + if (actualTimezone != null) timezone = actualTimezone; tz = TimeZone.getTimeZone(timezone); }

        Attachments

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              corellian Cristian Peraferrer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: