Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1027768 // Apache Velocity Test (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 1443K of libraries. Click here for Pure Java version (7287L/51K).

!7

// see function "velocityEval" (#1027770) for shortened version

lib 1400370 // velocity
lib 1011966 // slf4j
lib 1003719 // lang3

import org.apache.velocity.*;
import org.apache.velocity.app.*;

sS template = "Hello $name!";

p-exp {
  Velocity.init();
  new VelocityContext context;
  context.put("name", "Velocity");
  new StringWriter sw;
  assertTrue("Velocity evaluate", Velocity.evaluate(context, sw, "test-template", template));
  printWithIndent("HTML> ", sw);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027768
Snippet name: Apache Velocity Test (OK)
Eternal ID of this version: #1027768/6
Text MD5: e3f9417f9b31164add9a08875ee8c343
Transpilation MD5: 1702a1cc210d55dc16bbece16672fc14
Author: stefan
Category:
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-10 20:06:36
Source code size: 496 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 114 / 529
Version history: 5 change(s)
Referenced in: [show references]