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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.1
    • 2.2.1
    • Other
    • None
    • any

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: