Click
  1. Click
  2. CLK-606

Remove Click core's dependency on Velocity

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.1.0 RC1
    • Fix Version/s: 2.2.0
    • Component/s: core
    • Labels:
      None
    • Environment:
      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.

        Activity

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Andrew Fink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development