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

Java escape sequences should work in Velocity macros

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Later
    • 1.5 beta2
    • None
    • Engine
    • None

    Description

      Following test should work:

      ===
      public void testJavaEscape() throws Exception

      { VelocityEngine ve = new VelocityEngine(); ve.init(); Context context = new VelocityContext(); StringWriter writer = new StringWriter(); ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v"); assertEquals("a", writer.toString()); writer = new StringWriter(); ve.evaluate(context, writer, "test","#set($v = \"\\n\")$v"); assertEquals("\n", writer.toString()); }

      ===

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            yozh Stepan Koltsov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment