EJB3 Entity with GWT
1.GWT client 端需要编译成javascript,所以要在 GWT client端使用EJB Entity,则在 client端需要有Entity的源码,
Entity的源码可以在 EJBModel 打包时换源码打包进jar包(用maven):
<build>
<!--如果不手动指定resource则默认打包 resources目录下的内容,手动指定后则只打包指定的内容 下例中 ejbmodel为Entity所在目录-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/ejbmodel/*.java</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
2. 还需要 all enums & interfaces from javax.persistence java.io.Serializable as an alias for com.google.gwt.user.client.rpc.IsSerializable
参考 http://code.google.com/p/ejb4gwt/
3. 这样Entity Bean 就可以在 client 端通过编译了.
1.GWT client 端需要编译成javascript,所以要在 GWT client端使用EJB Entity,则在 client端需要有Entity的源码,
Entity的源码可以在 EJBModel 打包时换源码打包进jar包(用maven):
<build>
<!--如果不手动指定resource则默认打包 resources目录下的内容,手动指定后则只打包指定的内容 下例中 ejbmodel为Entity所在目录-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/ejbmodel/*.java</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
2. 还需要 all enums & interfaces from javax.persistence java.io.Serializable as an alias for com.google.gwt.user.client.rpc.IsSerializable
参考 http://code.google.com/p/ejb4gwt/
3. 这样Entity Bean 就可以在 client 端通过编译了.
本文介绍如何在GWT客户端集成EJB3实体,包括将实体源码打包至jar文件的方法,以及确保实体能在客户端正确编译所需的配置。
246

被折叠的 条评论
为什么被折叠?



