开发者

Help configuring Hibernate,Jpa, Stripesist on Stripes

I need some help configuring JPA Str开发者_StackOverflow社区ipersist 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜