Use if( GWT.isClient() ) in your code to decide if its client side or server side.
See the class EscapeUtil for example - http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/rpc/client/impl/EscapeUtil.java#27 --Sri On 5 May 2010 20:29, stingermn <[email protected]> wrote: > I have an interface, XYZ, which is implemented on the client side as > class ClientXYZ and on the server side as class ServerXYZ. I would > like to have a common utility method, getXYZ(), which can be called > from both client and server and will return either ClientXYZ or > ServerXYZ depending on if the method is invoked on the client or > server side. Does anyone know if this is possible? Thanks. > > -- > 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]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- 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.
