4

I have a server instance that uses velocity macros to generate testcases. There is a new requirement that the string returned by the macros should be in base64. I could easily do it in the server side after i get my data back from the macro, but it has to be done for only a select cases.

So what i wonder is, will it be possible to create a velocity macro, that would Base64 encode the given string?

user3269589
  • 115
  • 1
  • 6

1 Answers1

1

First create a java class capable to convert/generate Base64 strings. Thus you could pass an instance of this class to your velocity macro and use it to generate/convert the string you want to Base64 inside your velocity macro scope. Hope it helps.

danvalho
  • 36
  • 2