You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit, giovann...@gmail.com
Hi All,
I am trying to use an external class in my client side interfaces.
I added the myClass (which is a JDO persisted object) in a shared
package as the class will be shared between client and server.
I added in my .gwt.xml file <source path="shared"/> for the client to
be able to see the class, which is working.
The problem though is that myClass uses the
com.google.appengine.api.users.User
class and when I try to compile I get the error
[ERROR] Line 12: The import com.google.appengine cannot be resolved
[ERROR] Line 33: User cannot be resolved to a type
How can I make the appengine User class visible to the client so that
I get rid of that error?
Thanks in advance,
Matteo
Rajeev Dayal
unread,
May 4, 2009, 5:13:33 PM5/4/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-We...@googlegroups.com
Any code that must be shared between the client and the server must have all classes which it imports available on the client side. In this case, you cannot actually have a JDO class which imports server-side classes as a class that will be shared between the client and the server.
What you'll need to do is create a set of DTO objects which are used as a transport mechanism for the data between the client and the server. These DTO objects should not have any dependencies on your JDO classes; instead, your server code should instantiate a new DTO, and populate its fields with data from the JDO object.
There has been discussion about making JDO classes directly usable by GWT's RPC mechanism, but a definitive solution does not exist as yet. See the following thread for more information: