Wicket 中的动态标记
是否可以动态生成 MarkupContainer
标记,即无需为其存储 HTML 文件?
我考虑过从数据库中将标记作为纯字符串读取,以提供类似 CMS 的功能。
Is it possible to generate the markup for a MarkupContainer
dynamically, i.e. without storing an HTML file for it?
I thought about reading the markup as a plain string from the database to offer CMS-like functionality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有趣的问题,我不确定是否可能,但我的猜测是开始查看 IMarkupLoader 和 IMarkupResourceStreamProvider 接口和实现类,看看您离那里有多远。
我对您发现/实现的任何能真正完成此任务的东西感兴趣!
Interesting question and I'm not sure if it is possible, but my guess would be to start off looking at the IMarkupLoader and IMarkupResourceStreamProvider interfaces and implementing classes and see how far you get from there.
I'd be interested in anything you find / implement that actually gets this done!
另一种(更简单)的方法是使用禁用标记转义的标签:
但要小心,因为这可能会导致安全漏洞(HTML/JS 注入)。
Another (simpler) way to do it would be to use a label with disabled markup escaping :
Be careful though, as this might lead to security breaches (HTML/JS injection).