Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Java system properties from Freemarker templates?

I started using Freemarker for assembling simple HTML pages, using FMPP Maven plugin. So far so good. But one thing I need to do is to include value of a system property (one of system properties Maven provides) on a page. Is there a way to access system properties from Freemarker templates? (if not, I may just have to hack plugin to allow passing values from Maven)

like image 887
StaxMan Avatar asked Mar 03 '26 14:03

StaxMan


1 Answers

cf https://community.jivesoftware.com/thread/14820

You can access it like this :

${statics['java.lang.System'].getProperty("my.property")}

cf documentation here : http://freemarker.sourceforge.net/docs/pgui_misc_beanwrapper.html

like image 69
Bruno Thomas Avatar answered Mar 06 '26 03:03

Bruno Thomas