Its been discussed before - see this
thread<http://groups.google.com/group/google-web-toolkit/browse_thread/thread/59b179bfbc9b718/3a21e6b0d450a787?lnk=gst&q=%40Server+Only+annotation#3a21e6b0d450a787>




--Sri


2009/10/30 Open eSignForms <[email protected]>

>
> I have checked around and cannot find out if there is any way to mark
> a method as "not serializable" in GWT 1.7 for a class that is
> otherwise serializable for RPC?
>
> I know I can use transient to mark a field that should not be
> serialized, but is there something I can do for a method (which
> apparently is also serialized so the javascript can use those methods
> too?)?
>
> The main use case is to construct a GWT client object based on one or
> more server domain objects as it's nearly impossible to limit your
> server world to only javascript-compatible types and methods and I'd
> prefer my server objects not need to know about the myriad UI types
> across various front-ends.
>
> something like:
>
> public class User
>        implements java.io.Serializable
> {
>        private static final long serialVersionUID = -8641764813147512309L;
>
>        public String email;
>        public String displayName;
>        public String personalName;
>        public String familyName;
>        public Date lastLoginDate;
>        public Date createdDate;
>        public String createdByEmail;
>        public String createdByDisplayName;
>
>        public User() {}
>
>        @transient-so-GWT-compiler-won't-complain-my.domainobject.User-
> is-not-also-serializable-since-it's-never-sent-over-the-wire-anyway
>        public User( my.domainobject.User u )
>        {
>             email = u.getEmail();
>             displayName = u.getDisplayName();
>             ....
>             lastLoginDate = u.getLastLoginDate().toDate();
>             ....
>        }
> }
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to