Re: Using class on both client and server sides
And what if i want to use a package both on the client and server side, but one of the classes has imports from app engine witch cannot be used in GWT. Can i instruct the compiler (let's say in the .gwt.xml file) to exclude a class from a package when compiling ? On Jul 29, 6:18 pm, Nuno brun...@gmail.com wrote: Also, if you class is just a pojo you dont really need to create it in two places... the server code can access all of your client code. You just need to make the classes you want to transport from client to server or vice versa. In your example Contact may stay in the client package, and if you need to send a Contact object to the server, or make the server send it to you, just make this class Serializable. On Wed, Jul 29, 2009 at 12:10 PM, Paul Robinson ukcue...@gmail.com wrote: You want this in your gwt.xml file: source path=client/ source path=shared/ Note that if any source... element appears in your gwt.xml, then the implied client source path is not added for you - so you will need both of the above. Paul Ice13ill wrote: Hello, I'm trying to use a class (let's say Contact) on both client and server sides (packages: com.app.client and com.app.server). For that purpose I created a shared package (com.app.shared) in which to put the Contact class. But gwt (client side) only sees classes in com.app.client package. How can I use the Contact class on client side for the com.app.shared package? Do I have to add a inherits tag in my .gwt.xml file ? Thanks. -- Quer aprender a programar? acompanhe: Wants to learn GWT? Follow this blog - http://tcninja.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Using class on both client and server sides
On 24 août, 12:28, Ice13ill andrei.fifi...@gmail.com wrote: And what if i want to use a package both on the client and server side, but one of the classes has imports from app engine witch cannot be used in GWT. Can i instruct the compiler (let's say in the .gwt.xml file) to exclude a class from a package when compiling ? Yes, source/ supports ANT-like filter attributes: http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuidePathFiltering See also http://code.google.com/p/google-web-toolkit/wiki/ResourceOracle for the gory details. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Using class on both client and server sides
this is the correct response, tho, I put all inter-client-server classes in shared/rpc, or some such package. On Jul 29, 11:10 am, Paul Robinson ukcue...@gmail.com wrote: You want this in your gwt.xml file: source path=client/ source path=shared/ Note that if any source... element appears in your gwt.xml, then the implied client source path is not added for you - so you will need both of the above. Paul Ice13ill wrote: Hello, I'm trying to use a class (let's say Contact) on both client and server sides (packages: com.app.client and com.app.server). For that purpose I created a shared package (com.app.shared) in which to put the Contact class. But gwt (client side) only sees classes in com.app.client package. How can I use the Contact class on client side for the com.app.shared package? Do I have to add a inherits tag in my .gwt.xml file ? 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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Using class on both client and server sides
Hello, I'm trying to use a class (let's say Contact) on both client and server sides (packages: com.app.client and com.app.server). For that purpose I created a shared package (com.app.shared) in which to put the Contact class. But gwt (client side) only sees classes in com.app.client package. How can I use the Contact class on client side for the com.app.shared package? Do I have to add a inherits tag in my .gwt.xml file ? 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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Using class on both client and server sides
You want this in your gwt.xml file: source path=client/ source path=shared/ Note that if any source... element appears in your gwt.xml, then the implied client source path is not added for you - so you will need both of the above. Paul Ice13ill wrote: Hello, I'm trying to use a class (let's say Contact) on both client and server sides (packages: com.app.client and com.app.server). For that purpose I created a shared package (com.app.shared) in which to put the Contact class. But gwt (client side) only sees classes in com.app.client package. How can I use the Contact class on client side for the com.app.shared package? Do I have to add a inherits tag in my .gwt.xml file ? 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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Using class on both client and server sides
That worked... thanks a lot :) On Jul 29, 6:10 pm, Paul Robinson ukcue...@gmail.com wrote: You want this in your gwt.xml file: source path=client/ source path=shared/ Note that if any source... element appears in your gwt.xml, then the implied client source path is not added for you - so you will need both of the above. Paul Ice13ill wrote: Hello, I'm trying to use a class (let's say Contact) on both client and server sides (packages: com.app.client and com.app.server). For that purpose I created a shared package (com.app.shared) in which to put the Contact class. But gwt (client side) only sees classes in com.app.client package. How can I use the Contact class on client side for the com.app.shared package? Do I have to add a inherits tag in my .gwt.xml file ? 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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Using class on both client and server sides
Also, if you class is just a pojo you dont really need to create it in two places... the server code can access all of your client code. You just need to make the classes you want to transport from client to server or vice versa. In your example Contact may stay in the client package, and if you need to send a Contact object to the server, or make the server send it to you, just make this class Serializable. On Wed, Jul 29, 2009 at 12:10 PM, Paul Robinson ukcue...@gmail.com wrote: You want this in your gwt.xml file: source path=client/ source path=shared/ Note that if any source... element appears in your gwt.xml, then the implied client source path is not added for you - so you will need both of the above. Paul Ice13ill wrote: Hello, I'm trying to use a class (let's say Contact) on both client and server sides (packages: com.app.client and com.app.server). For that purpose I created a shared package (com.app.shared) in which to put the Contact class. But gwt (client side) only sees classes in com.app.client package. How can I use the Contact class on client side for the com.app.shared package? Do I have to add a inherits tag in my .gwt.xml file ? Thanks. -- Quer aprender a programar? acompanhe: Wants to learn GWT? Follow this blog - http://tcninja.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---