I´m not sure you can solve this particular problem the way DaveS
suggested, not without modifying the class anyway.
Even if you created a separate .jar and referenced that from your
client project, the GWT compiler wouldn´t understand the annotations.
My problem was similar to yours, and would be solved by creating a new
even simpler class like this:
Public class PhotoSetStoreDTO {
private String setid;
private String title;
private String description;
private String primaryPhotoURL;
public PhotoSetStore(String id, String title, String descString,
String photoURL) {
setSetID(id);
setTitle(title);
setDescrption(descString);
setPrimaryPhotoURL(photoURL);
}
}
Then use Dozer or a similar mapping framework to do the mapping
between server side and client side objects.
I haven´t been working with GAE at all to be honest, so there might be
a better approach.
On 9 Nov, 18:39, Sanjith Chungath <[email protected]> wrote:
> Thanks to all for your suggestions.
>
> As my application needs to be deployed in google app engine, I doubt whether
> I can move those classes from server to client. I use JDO to persist objects
> to the GAE data store. The class is a simple class and I have mentioned it
> below,
>
> @PersistenceCapable(identityType = IdentityType.DATASTORE)
> public class PhotoSetStore {
> @PrimaryKey
> @Persistent
> private String setid;
>
> @Persistent
> private String title;
>
> @Persistent
> private String description;
>
> @Persistent
> private String primaryPhotoURL;
>
> public PhotoSetStore(String id, String title, String descString,
> String photoURL) {
> setSetID(id);
> setTitle(title);
> setDescrption(descString);
> setPrimaryPhotoURL(photoURL);
>
> }
> }
>
> Dave, it looks simple approach to have a (java) project to have common
> classes defined. I need few clarifications, do you have seperate projects
> for GWT client code and server code? If not, how did you added the common
> .jar file to the client code?
>
> Also, I didnt quiet get how the common .jar file is different from the class
> existing in a server package of same GWt project!
>
> -Sanjith
>
>
>
> On Mon, Nov 9, 2009 at 5:10 PM, sathya <[email protected]> wrote:
>
> > Hi,
> > You can serialize classes only defined in client side(not server
> > side).Class you defined on server side should be moved to client side
> > to serialize.
>
> > On Nov 9, 4:01 pm, DaveS <[email protected]> wrote:
> > > That's how we did it originally, but then we created a separate GWT
> > > project (well, actually it's just a JAR project) that defines all our
> > > types that are common over the RPC interfaces. We reference that
> > > project in both the server and client projects, and the JAR gets
> > > pulled into the client side and GWT happily generates JS code from it.
> > > We now also use it for some 'shared' client-side classes as well so
> > > it's effectively just a library project.
>
> > > DaveS.
>
> > > On Nov 9, 3:35 am, rjcarr <[email protected]> wrote:
>
> > > > Hi Sanjith-
>
> > > > I don't completely follow your question but any shared code between
> > > > the client and the server has to reside in the client package (by
> > > > default). This is because GWT can only see code in the modules you
> > > > have defined and the server package isn't a GWT module (again, by
> > > > default).
>
> > > > Hope this helps!
>
> > > > On Nov 8, 10:30 am, Sanjith Chungath <[email protected]> wrote:
>
> > > > > Greetings to all,
> > > > > I have defined a class in the server and want to get a list of
> > > > > objects (of that class) as return parameter of an async call. But
> > while
> > > > > compile I got following error "No source code is available for type
> > > > > com.abc.pqr.data.XXX; did you forget to inherit a required module?".
> > I know
> > > > > that it is because GWT dont know the java script code for
> > coresponding
> > > > > class. What is the general practice to use a object of class in
> > server side
> > > > > at client code, serialize it? or any other better way.
>
> > > > > -Sanjith.- Hide quoted text -
>
> > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---