Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3770

VelocityPanel does'n escape special char from Model

    XMLWordPrintableJSON

Details

    Description

      When Model contains variable with special char (i.e. '<') generated output is broken.
      ...
      map.put("test", "<thisistest");

      templateContext = Model.ofMap(map);
      vp = new VelocityPanel("velpanel", templateContext) {
      ...

      I have patched in official Velocity way in. VelocityPanel lines about 191:
      import org.apache.velocity.app.event.EventCartridge;
      import org.apache.velocity.app.event.implement.EscapeHtmlReference;
      ....

      final VelocityContext ctx = new VelocityContext(map);

      EventCartridge ec = new EventCartridge();
      ec.addEventHandler(new EscapeHtmlReference());
      ec.attachToContext(ctx);

      Patched project require maven dependency of "oro" because of exception

      Attachments

        Activity

          People

            Unassigned Unassigned
            jacekcz Jacek Czerwinski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: