生成JSF2 CRUD-是否可以为任何实体自动创建bean和xhtml? [英] Generate JSF2 CRUD's - Can I create the bean and xhtml automatically for any entity?

查看:234
本文介绍了生成JSF2 CRUD-是否可以为任何实体自动创建bean和xhtml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找可以使用Java Server Faces 2和Richfaces 4技术自动生成任何实体的任何CRUD的MVC文件(bean和xhtml视图)的任何类型的软件.

I'm looking for any kind of software which allows me to generate, in an automatically way, the MVC files (a bean and a xhtml view) of any CRUD of any entity using Java Server Faces 2 and Richfaces 4 technologies.

我认为一种解决方案是使用Eclipse的Hibernate Tools插件,创建像Dao代码生成器这样的导出器,但我不知道是否有可能或如何做到这一点.我进行了搜索,但没有找到任何相关文档.

I think one solution would be to use the Hibernate Tools plugin for Eclipse, creating an exporter like the Dao code generator but I don't know if it is possible or how can i do that. I search but I didn't find any documentation about it.

您知道哪个是解决此问题的最佳方法吗?还有其他有趣的软件吗?

Do you know which is the best solution for this issue? Any other interesting software?

谢谢!

推荐答案

Netbeans具有该功能,它可以基于实体类生成CRUD.这是它为您选择的每个实体生成的:

Netbeans has that feature, based on an entity class it can generate CRUD. This is what it generates for each entity you choose:

  • 扩展AbstractFacade.java的无状态会话Bean
  • 一个JSF会话范围内的托管bean
  • 包含四个具有CRUD功能的Facelets文件(Create.xhtml,Edit.xhtml,List.xhtml和View.xhtml)的目录

它还会生成:

  • 包含用于以下方面的业务逻辑的AbstractFacade.java类 创建,检索,修改和删除实体实例
  • JSF托管bean(JsfUtil,PaginationHelper)使用的
  • 实用程序类
  • 用于本地化消息的属性包,以及项目的Faces配置文件(Afaces-config.xml中的对应条目) 如果尚不存在该文件,则创建该文件.)
  • 辅助Web文件,包括用于呈现组件的默认样式表和Facelets模板文件
  • the AbstractFacade.java class that contains the business logic for creation, retrieval, modification and removal of entity instances
  • utility classes used by the JSF managed beans (JsfUtil, PaginationHelper)
  • a properties bundle for localized messages, and a corresponding entry in the project's Faces configuration file (A faces-config.xml file is created if one does not already exist.)
  • auxiliary web files, including a default stylesheet for rendered components, and a Facelets template file

您必须更新生成的代码才能使用richfaces.

you'll have to update the generate code to use richfaces.

这是有关如何执行此操作的教程: https://netbeans.org/kb/docs/web/jsf20-crud.html

Here's a tutorial on how to do it: https://netbeans.org/kb/docs/web/jsf20-crud.html

这篇关于生成JSF2 CRUD-是否可以为任何实体自动创建bean和xhtml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆