Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

vtl

Replace a Substring of a String in Velocity Template Language

June 13, 2023 by Tarik

By default you can use the methods of the Java String object: #set( $a = “Hello” ) #set( $b = $a.replace(“l”, “+”) ) ${b} will produce He++o and you can also use velocity variables as arguments to your method calls, e.g.: #set( $a = “Hello” ) #set( $b = “+” ) #set( $c = $a.replace(“l”, … Read more

Categories string Tags replace, string, velocity, vtl Leave a comment

Create and iterate through an array in Velocity Template Language

June 1, 2023 by Tarik

According to Apache Velocity User Guide, right hand side of assignments can be of type Variable reference List item String literal Property reference Method reference Number literal ArrayList Map You can create an empty list, which would satisfy all your needs for an array, in an Apache Velocity template with an expression like: #set($foo = … Read more

Categories vtl Tags vtl Leave a comment

Is there a way to generate multiple files/classes with intellij code/file templates? [duplicate]

April 14, 2023 by Tarik

This feature seems to be available in ReSharper (another JetBrains IDE). It still does not seem possible in IDEA yet.

Categories intellij-idea Tags code-generation, intellij-idea, vtl Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa