帮助配置 Hibernate、Jpa、Stripesist on Stripes
我需要一些帮助在 Stripes 项目上配置 JPA Stripersist 和 Hibernate 我有 Stripersist.jar 和 JPA.jar,我的书不太清楚如何获取“正确的”Hibernate jar(我刚刚在 hibernate 网站上找到了很多),以及将它们放在哪里(我想类路径)。 你们中的一些人成功配置了 Stripes 和 Hibernate、jpa、Stripersist 吗?
谢谢,不幸的是 Stripes 社区不是那么大,我找不到任何有用的信息
I need some help configuring JPA Stripersist and Hibernate on a Stripes project
I have the Stripersist.jar and JPA.jar, the book i have is not that clear about how to get the "correct" Hibernate jars(i just found so many on the hibernate website), and where to place them(i suppose the classpath).
Has some of you managed to configure Stripes and Hibernate,jpa,Stripersist successfully?
Thank you, unfortunately Stripes community is not that big and i cant find any useful info
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Stripes 是一个完全不了解持久性技术的 Web 框架。因此,您可能需要首先配置 Stripes,并确保 Stripes 配置正确并为您提供 hello world 操作:
http://www.stripesframework.org/display/stripes/Quick+Start+Guide
之后,您可能需要将 striperst.jar 添加到您的项目中。如果您将以下配置添加到 web.xml 中,则 Stripersist 的内容将自动获取,并且无需进一步配置即可确保在 Stripes Web 应用程序启动时启动 Hibernate:
当然,您还必须安装所有 Hibernate jar(请注意,您需要的不仅仅是 hibernate3.jar,您还需要在 /lib/required 目录中添加所有 hibernate jar,并且您可能还想使用像 c3po 这样的连接池)。
最重要的是,您需要提供一个用于配置 Hibernate 的 persistence.xml。此配置与 Stripes/Stripersist 完全无关,您可以使用在网上找到的任何 Hibernate 快速入门指南。 Redhat 文档是一个很好的起点:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-xmlconfig
之后就可以使用 Stripersist 了。
Stripes is a web framework that is totally unaware of the persistence technology. So you might want to start with configuring Stripes first and make sure Stripes is configured correctly and serves you a hello world action:
http://www.stripesframework.org/display/stripes/Quick+Start+Guide
After that you might want to add the striperst.jar to your project. The Stripersist stuff will be picked-up automatically if you add the configuration below to your web.xml and no further configuration is needed for making sure Hibernate will be started when you Stripes web application starts:
You of course will also have to install all Hibernate jars (note that you will need much more than just the hibernate3.jar, you also need to add all hibernate jars in the /lib/required directory and you also might also want to use a connection pool like c3po).
And most importantly you will need to provide a persistence.xml that configures Hibernate. This configuration is totally unrelated to Stripes/Stripersist, you can use any Hibernate quick start guide you can find on the Net. An excellent starting point is the Redhat documentation:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html#configuration-xmlconfig
After that you can use the Stripersist.