简体   繁体   English

gwt客户端和gwt服务器的Java公共库

[英]java common lib for gwt client and gwt server

I am wondering is there a way to use a common java lib (external jar) among gwt client and gwt server if 我想知道是否有一种方法可以在gwt客户端和gwt服务器之间使用通用的java lib(外部jar),如果

  • lib contains serializable objects only? lib只包含可序列化的对象吗?
  • the lib doesn't contain *.gwt.xml file? 该库不包含* .gwt.xml文件?

Thanks 谢谢

I don't think so. 我不这么认为。 The external lib must contain a *.gwt.xml file in order to specify which packages must be compiled by the GWT compiler. 外部库必须包含* .gwt.xml文件,以指定必须由GWT编译器编译的软件包。

I've had trouble getting this to work. 我很难让它正常工作。 Adding the non-gwt-project to the classpath in Eclipse and referencing those objects in client-side code didn't raise errors in Eclipse but GWT didnt like it when compiling. 在Eclipse的类路径中添加non-gwt-project并在客户端代码中引用这些对象不会在Eclipse中引发错误,但是GWT在编译时不喜欢它。 I was able to reference an object from outside the GET project in the server-side code and it compiled, but failed at runtime. 我能够在服务器端代码中从GET项目外部引用一个对象,并将其编译,但是在运行时失败。 I am hoping to do the same thing, if you do come across a solution please let me know. 我希望做同样的事情,如果您遇到解决方案,请告诉我。 Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM