Java POJO 代表 HTML 控件?
好吧,这可能是个白痴的想法...但是我们需要 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有 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.
您是否考虑过使用 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.