简体   繁体   English

将 html 中的自定义标签替换为 Java

[英]Replace custom tags in html with Java

is there a library on Java to help me to achieve custom tags replacement in html Java 上是否有一个库来帮助我在 html 中实现自定义标签替换

like for example here is a simple template:例如这里是一个简单的模板:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div> <p>$welcome_title</p> <p>$email_body</p> <p>$footer_text</p> </div> </body> </html>

Can i replace this custom tags ($welcome_title,$email_body,$footer_text) with values from java?我可以用 java 中的值替换这个自定义标签($welcome_title、$email_body、$footer_text)吗?

The idea is to have template with tags which can be replaced at runtime with values from java objects:)这个想法是使用带有标签的模板,这些标签可以在运行时用来自 java 对象的值替换:)

Also maybe (if there is a library) to generate straight away from html an PDF doc也可能(如果有库)直接从 html 生成 PDF 文档

Thanks:)谢谢:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM