Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to print all velocity context?

Tags:

java

velocity

I've got a velocity template and a legacy method that puts something in the context for this template.

Can I know all the variables that are enabled in the template? May be something like that:

#printContext()
like image 864
Mikhail Kopylov Avatar asked Nov 27 '25 09:11

Mikhail Kopylov


1 Answers

You can try the following:

 #foreach( $key in $context.keys )
    $key = $context.get($key)
  #end

See also:

  • ContextTool
  • Interface Context
like image 67
Rong Nguyen Avatar answered Nov 29 '25 23:11

Rong Nguyen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!