Uploaded image for project: 'Click'
  1. Click
  2. CLK-606

Remove Click core's dependency on Velocity

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.1.0, 2.1.0 RC1
    • 2.2.0
    • core
    • None
    • click-nodeps-2.1.0-RC1-incubating.jar , click-extras-2.1.0-RC1-incubating.jar, ognl-2.6.9.jar, freemarket2.3.16.jar

    Description

      I use freemarker and dependencies in separate jars.
      I haven't 'velocity' in my classpath.
      So I found bug: common click core depends on Velocity.

      Namely:
      org.apache.click.ClickServlet.java
      org.apache.click.util.ErrorReport.java

      They both depend on
      org.apache.velocity.exception.ParseErrorException (search:
      instanceof ParseErrorException)
      and require Velocity be present in classpath even if freemarker are used.

      My workaround:
      I made fake public class ParseErrorException extends Exception {}.

      But you can make generic solution, for example:

      TemplateService
      + boolean isParseErrorException (Exception e)
      + Map<String, Object> describeParseErrorException (Exception e)

      or your own ClickTemplateException to wrap low level velocity/freemarker exceptions.

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            andreyrybin Andrew Fink
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment