开发者

Wicket: templatized javascript in <body>?

开发者 https://www.devze.com 2023-03-18 17:34 出处:网络
Previously I\'ve used TextTemplateHeaderContributor.forJavaScript() to add Javascript to the page &l开发者_如何学编程t;head> from a template file.

Previously I've used TextTemplateHeaderContributor.forJavaScript() to add Javascript to the page &l开发者_如何学编程t;head> from a template file.

Is there any way to do the same thing, but have the interpolated JS appear in the page <body> ?


See org.apache.wicket.util.template.TextTemplate and its family. You can feed it, interpolate and get its content (#getString()), then you can render the string in a Label for example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号