帮助在Stripes上配置Hibernate,Jpa和Stripesist [英] Help configuring Hibernate,Jpa, Stripesist on Stripes

查看:92
本文介绍了帮助在Stripes上配置Hibernate,Jpa和Stripesist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助在Stripes项目上配置JPA Stripersist和Hibernate
我有Stripersist.jar和JPA.jar,这本书并不清楚如何获得正确的Hibernate jar(我刚刚在hibernate网站上发现了很多),以及它们的放置位置(我认为是类路径)。
有些人设法成功地配置Stripes和Hibernate,jpa,Stripersist吗?

谢谢,不幸的是Stripes社区不是那么大,我找不到任何有用的信息

解决方案

Stripes是一个完全不了解持久性技术的Web框架。因此,您可能首先要先配置Stripes,并确保Stripes配置正确,并为您提供hello world动作: $ b

http://www.stripesframework.org/display/stripes/Quick+Start+Guide



之后,您可能需要将striperst.jar添加到您的项目中。如果您将下面的配置添加到web.xml中,Stripersist的东西将自动被拾取,并且不需要进一步的配置来确保在Stripes web应用程序启动时启动Hibernate:

 < filter> 
< display-name>条纹过滤< / display-name>
< filter-name> StripesFilter< / filter-name>
< filter-class> net.sourceforge.stripes.controller.StripesFilter< / filter-class>
< init-param>
< param-name> Extension.Packages< / param-name>
< param-value>
org.stripesstuff.stripersist
< / param-value>
< / init-param>
< / filter>

您当然也必须安装所有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 a>



之后,您可以使用Stripersist。

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

解决方案

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:

<filter>
  <display-name>Stripes Filter</display-name>
  <filter-name>StripesFilter</filter-name>
  <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
  <init-param>
    <param-name>Extension.Packages</param-name>
    <param-value>
      org.stripesstuff.stripersist
    </param-value>
  </init-param>
</filter>

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.

这篇关于帮助在Stripes上配置Hibernate,Jpa和Stripesist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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