Java POJO 代表 HTML 控件?

发布于 2024-09-26 10:44:20 字数 229 浏览 9 评论 0原文

好吧,这可能是个白痴的想法...但是我们需要 DropDownList.java 来包装“列出员工”下拉列表的所有数据。该对象在服务器端填充,并由 JSP 和 javascript (json) 用于渲染视图。就像 org.apache.struts2.components.Select 一样,但采用 POJO 格式。

我们已经创建了自己的类,但如果有一些好的框架或库可以制作此类内容,我们会愿意使用它。

多谢

Well, it may be a idiot idea... But we need DropDownList.java to wrap all data of a "List employees" dropdown list. The object is populated at server side and used by JSP and javascript (json) for rendering view. Just something like org.apache.struts2.components.Select but in POJO format.

We already created our own classes but if there is some good framework or lib that made that kind of stuff, we would willingly use it.

Thanks alot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青巷忧颜 2024-10-03 10:44:20

Java HTML 生成器,但 API 有点笨拙。如果可以的话,请使用 Builder API 在 Groovy 中编写 HTML 生成器。

Groovy 代码被编译为普通的类文件,只需要类路径上的 groovy.jar 即可。

There is Java HTML Generator but the API is a bit clumsy. If you can, write the HTML generator in Groovy using the Builder API.

Groovy code is compiled to normal class files which just needs the groovy.jar on the classpath.

み青杉依旧 2024-10-03 10:44:20

您是否考虑过使用 Google 网络工具包 (GWT)?

这可能是我见过的渲染浏览器内容的最干净的解决方案之一。 POJO 由 GWT“编译”为本机 JScript 和 HTML。有关浏览器兼容性的问题由 GWT 处理。

使用 GWT 完成一个大型项目后,我可以证明这是一个非常适合生产的工具,可扩展且响应迅速。

Have you considered using Google's Web Toolkit (GWT)?

This is probably one the cleanest solutions for rendering browser content I have seen. POJO's are "compiled" into native JScript and HTML by GWT. Concerns about browser compatability are dealt with by GWT.

After completing a large project using GWT I can testify that this is very much a production ready tool, both scalable and responsive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文