English 中文(简体)
我如何在《维也纳条约法公约》客户代码和服务器代码之间分享一个班子?
原标题:How can I share a class between GWT client code and server code?
  • 时间:2012-01-13 18:10:25
  •  标签:
  • java
  • gwt

是否可以在《维也纳条约法公约》客户代码和服务器代码之间“共享” Java级?

I have a simple class that just holds a few Strings and a few List<String> s. I d like to be able to use this class in both client side code and server side code just for some consistency.

只是为了提供某种背景,试图分享的Im这一类只是一个带有某些额外信息错误信息的集装箱。 在我的申请中,有一些错误妨碍储蓄,因此我们在客户方面进行这些检查(储蓄前)。 然后,在节省费用之后,我们对服务器一侧所节省的物体进行更多的“验证”检查。

我的理解是,它必须两次“汇编”一次,一次为《世界展望》汇编一次,一次为普通的javac汇编,但似乎有可能这样做。

是否有办法制定我的《世界展望》项目来做到这一点?

最佳回答

采用全球价值链的一个原因是客户和服务器采用单一领域模式。

在服务器代码和客户之间共享班级是一种常见的做法。

通常与WT客户代码的项目分成三个包。

com.yourpackage
               -shared
               -client
               -server

<代码>共享的包裹汇编成单体编码和javascript,client至javascript,服务器侧逻辑载于server

客户汇编途径可在<代码>*.gwt.xml文档中配置。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...