Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-736

Introspection regression from 1.5 to 1.6.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.2
    • 2.0
    • Engine
    • None
    • Sun JDK 1.5

    Description

      When upgrading from Velcocity 1.5 to 1.6.2, the following snippet of code changed behavior.

      In Velocity 1.5, the output was:

      The file upload exceeded 100

      In Velocity 1.6.2, the output is:

      The file upload exceeded $ex.permittedSize

      There is nothing in the velocity log file to help me identify why it's not resolving 'permittedSize' to the correct bean method.

      Here is a test program to replicate the problem. The context variable in question is the Commons FileUpload exception class documented here:

      http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileUploadBase.SizeLimitExceededException.html

      I am using commons-fileupload-1.2.jar

      import java.io.StringWriter;
      import org.apache.commons.fileupload.FileUploadBase;
      import org.apache.velocity.VelocityContext;
      import org.apache.velocity.app.VelocityEngine;
      import org.apache.velocity.context.Context;

      public class Main {
      public static void main(String[] args) throws Exception

      { VelocityEngine e = new VelocityEngine(); String testTemplate = "The file upload exceeded $ex.permittedSize"; StringWriter out = new StringWriter(); Context ctx = new VelocityContext(); FileUploadBase.FileSizeLimitExceededException ex = new FileUploadBase.FileSizeLimitExceededException("too big!", 50, 100); ctx.put("ex",ex); e.evaluate(ctx, out, "Tester", testTemplate); System.out.println(out.toString()); }

      }

      Attachments

        1. Velocity736TestCase.java
          2 kB
          Nathan Bubna

        Issue Links

          Activity

            People

              cbrisson Claude Brisson
              daveespo David Esposito
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: