Re: GWT 2.1 hellomvp using GIN
Hi, Have you written any tests for this? Im curious about the testing abilities of a GWT app which uses GIN etc using EasyMock or Mockito or something. I've been told that it's very easy to test with Junit tests.. is this the case? Do you have any examples? Thanks in advance, Frank B On Oct 24, 12:56 pm, moejo mahamad.el.tan...@gmail.com wrote: Hi Amir, Yes, your absolutely right - forgot to call setFactory! Now everything is working stunningly. I've put together a sample bit of code using the Contact Details code I mentioned previously and it can be downloaded at: http://www.bright-creations.com/wp-content/uploads/2010/10/ContactsCl... If you guys have any comments about the code, please let me know. Thanks for all your advice, you guys have been seriously helpful. Cheers Moe On Oct 24, 10:16 am, Amir Kashani amirkash...@gmail.com wrote: Moe, Are you using PlaceHistoryMapperWithFactory? If so, my best guess is that you're forgetting to call setFactory in your onModuleLoad(): AppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class); historyMapper.setFactory(ginjector.getAppPlaceFactory()); If that's not it, take a look at the generated code to see if you can figure out what exactly is null on that line (-gen compiler option). HTH. - Amir On Oct 23, 2:54 pm, moejo mahamad.el.tan...@gmail.com wrote: Hi All, I'm working on getting an example together and I am having issues setting up the injectors for the code you've suggested above (Amir, david, Aodhagán). So far, I've setup everything as you've suggested for the AppActivityMapper, AppPlaceFactory, AppPlaceHistoryMapper, Places and ActivityPlace. However, I am obviously missing something in the GIN module itself (apologize in advance, just started to use GIN). The pages are changing successfully, but no history token changes are made. The error i get is: Caused by: com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java: 214) Caused by: java.lang.NullPointerException: null at com.google.gwt.sample.contacts.client.mvp.AppPlaceHistoryMapperImpl.getPref ixAndToken(AppPlaceHistoryMapperImpl.java: 24) at com.google.gwt.place.impl.AbstractPlaceHistoryMapper.getToken(AbstractPlace HistoryMapper.java: 66) at com.google.gwt.place.shared.PlaceHistoryHandler.tokenForPlace(PlaceHistoryH andler.java: 156) at com.google.gwt.place.shared.PlaceHistoryHandler.access $1(PlaceHistoryHandler.java:151) at com.google.gwt.place.shared.PlaceHistoryHandler $1.onPlaceChange(PlaceHistoryHandler.java:103) at com.google.gwt.place.shared.PlaceChangeEvent.dispatch(PlaceChangeEvent.java : 57) at com.google.gwt.place.shared.PlaceChangeEvent.dispatch(PlaceChangeEvent.java : 1) at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java: 204) at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java: 103) at com.google.gwt.place.shared.PlaceController.goTo(PlaceController.java: 120) at com.google.gwt.sample.contacts.client.activity.ContactActivity $1.onClick(ContactActivity.java:94) My NewContactPlace is as follows: public class NewContactPlace extends ActivityPlaceEditContactActivity { @Inject public NewContactPlace(EditContactActivity activity) { super(activity); GWT.log(NewContactPlace.ActivityProvider: + activity); } private String placeName; public void setPlaceName(String token) { this.placeName = token; } public String getPlaceName() { return placeName; } @Prefix(new) public static class Tokenizer implements PlaceTokenizerNewContactPlace { // Since the place is injectable, we'll let Gin do the construction. private final ProviderNewContactPlace placeProvider; @Inject public Tokenizer(ProviderNewContactPlace placeProvider) { this.placeProvider = placeProvider; GWT.log(NewContactPlace.Tokenizer.PlaceProvider: + placeProvider); } @Override public String getToken(NewContactPlace place) { return place.getPlaceName(); } @Override public NewContactPlace getPlace(String token) { NewContactPlace place = placeProvider.get(); place.setPlaceName(token); return place; // If place requires any more work, do it here. } } }
Re: gwt-maven-plugin 2.1.0-1 compilation error
using your original command mvn archetype:generate -DarchetypeRepository=repo1.maven.org -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.1.0-1 the script is asking for a groupId then arctifactId then Module and asks for confirmation (Y) and builds OK ( BUILD SUCCESS) the mvn package works - Original Message - From: Frank Bølviken frank.bolvi...@gmail.com To: Google Web Toolkit google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 7:22 PM Subject: Re: gwt-maven-plugin 2.1.0-1 compilation error I just dont understund why I cant use the gwt-maven-plugin 2.1.0-1, which comes with gwt 2.1.0 and is easily integrated with eclipse etc? Can you please try and run that command, and give me your findings? Frank On Dec 22, 6:54 pm, Coelho metronome.ba...@worldonline.fr wrote: Somehow the plugin tha generates the 232 has been changed ( it asket for a version after the 232 and doesn't ask anymore ) You can build webapp for gwt with mvn archetype:generate # 15 # 276 # 60 but 232 was the only one to generate a pom with gwt 2.1 you can probably change the version in 15 60 and 276 Patrick - Original Message - From: Coelho metronome.ba...@worldonline.fr To: google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 6:38 PM Subject: Re: gwt-maven-plugin 2.1.0-1 compilation error though I don't know why but I 'v used this command with succes several times but I'v just tried it on 2 Pcs ( linux debian and windows xp ) with the same error ? I can still mvn package on existin projects ! Patrick - Original Message - From: Frank B lviken frank.bolvi...@gmail.com To: Google Web Toolkit google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 6:13 PM Subject: Re: gwt-maven-plugin 2.1.0-1 compilation error I thought it was supposed to be simpler with the new gwt-maven-plugin 2.1.0-1 with eclipse etc.. :P On Dec 22, 5:57 pm, Frank B lviken frank.bolvi...@gmail.com wrote: When i tried that, I get: [INFO] BUILD FAILURE [INFO] [INFO] Total time: 18.320s [INFO] Finished at: Wed Dec 22 17:55:54 CET 2010 [INFO] Final Memory: 7M/77M [INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven- archetype-plugin:2 .0:generate (default-cli) on project standalone-pom: Template 'src/ main/resource s/layer.xml' not in directory 'src/main/java' - [Help 1] [ERROR] On Dec 22, 5:42 pm, Metronome / Basic metronome.ba...@worldonline.fr wrote: You can create a simple project with the mvn achetype:generate # 232 with maven 3 - Original Message - From: Frank B lviken frank.bolvi...@gmail.com To: Google Web Toolkit google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 5:33 PM Subject: gwt-maven-plugin 2.1.0-1 compilation error Hi, I dont know if there is anyting I have missed. But I'm trying to create a simple GWT project with the new gwt-maven-plugin. I run the following command: mvn archetype:generate -DarchetypeRepository=repo1.maven.org -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.1.0-1 I input the following text: Define value for property 'groupId': : com.test.hello Define value for property 'artifactId': : gwt Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.test.hello: Define value for property 'module': : gwt The project is created successfully. But when I try to gwt:compile it, the following error arrives: [INFO] Compiling module com.test.hello.gwt [INFO] Validating newly compiled units [INFO] [ERROR] Errors in 'file:/C:/PATH/gwt/src/main/java/com/ test/hello/client/gwt.java' [INFO] [ERROR] Line 35: GreetingServiceAsync cannot be resolved to a type [INFO] [ERROR] Line 35: No source code is available for type GreetingServiceAsync; did you forget to inherit a required module? [INFO] [ERROR] Line 35: The method create(Class?) from the type GWT refers to the missing type GreetingServic eAsync [INFO] [ERROR] Line 37: Messages cannot be resolved to a type [INFO] [ERROR] Line 37: No source code is available for type Messages; did you forget to inherit a required mod ule? [INFO] [ERROR] Line 37: The method create(Class?) from the type GWT refers to the missing type Messages [INFO] [ERROR] Line 37: Messages cannot be resolved to a type [INFO] [ERROR] Line 43: Messages cannot be resolved to a type [INFO] [ERROR] Line 45: Messages cannot be resolved to a type [INFO] [ERROR] Line 123: GreetingServiceAsync cannot be resolved to a type [INFO] Finding entry point classes [INFO] [ERROR] Unable to find type 'com.test.hello.client..gwt' [INFO] [ERROR] Hint: Previous compiler
Re: Custom Maps
Thank You! I had tried it but I had saw the wrong example in HelloMaps source tree... Now I've found the right one: http://code.google.com/p/gwt-google-apis/source/browse/?r=1533#svn%2Ftrunk%2Fmaps%2Fsamples%2Fhellomaps%2Fsrc%2Fcom%2Fgoogle%2Fgwt%2Fmaps%2Fsample%2Fhellomaps%2Fclient On 23 Dic, 00:48, Eric Ayers zun...@google.com wrote: Did you try the HelloMaps sample code in the library? See source in com.google.gwt.maps.sample.hellomaps.client.CustomMapTypeDemo http://code.google.com/p/gwt-google-apis/source/browse/?r=1533#svn%2F... On Wed, Dec 22, 2010 at 5:57 PM, Alberto sturialb...@gmail.com wrote: Hi everybody! I need an example about the creation of a Custom Map with Google Maps 1.1 Library... I want to create a custom map with my pictures... I was reading Class MapType (http://gwt-google-apis.googlecode.com/svn/javadoc/maps/ 1.1/com/google/gwt/maps/client/MapType.html) and Class TileLayer (http://gwt-google-apis.googlecode.com/svn/javadoc/ maps/1.1/com/google/gwt/maps/client/TileLayer.html) but I'need an example to see how they works... Can anyone help me with a little example? Thank You very much! -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/google-web-toolkit?hl=en. -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- 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-tool...@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.
GWT Classpath to add new libraries
Hello I'd like to add this library to my GWT project: http://code.google.com/p/gwt-mobile-webkit/wiki/StorageApi But theres only written I should add it to the classpath, but where is this exactly in a GWT project? -- 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-tool...@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: new window
thanks for the information, so conclusion is like i have to pass arguments for the new window, during the time of calling window.open right. -shiv On Wed, Dec 22, 2010 at 9:53 PM, Ben Imp benlee...@gmail.com wrote: Opening a new window is as simple as a call to Window.open. However, since your GWT client keeps all of its state in javascript your new window will know nothing of the old window. You can pass some arguments to this new window to get it in the right initial state, but thats about it. -Ben On Dec 22, 7:00 am, Shiv shankar shivuc.8...@gmail.com wrote: Actually in that new window tab buttons play a role in majority, by displaying graphs. so i need a new window, important thing is like presently running my code in local host so area am getting is very less, thinking that if the new window gets opened ill get enough space. thanks -shiv On Wed, Dec 22, 2010 at 6:09 PM, Cesar Ruiz crui...@gmail.com wrote: And normally what does it do?. Im confused. On 22 December 2010 13:37, Shiv shankar shivuc.8...@gmail.com wrote: HI all, On module load in the entry point only a new browser window has to be opened. does any body know this, how to do? kindly help me out. thanks in advance -shivu -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- Cesar Ruiz. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com google-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%252bunsubscr...@googlegroups.com . 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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . 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 google-web-tool...@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: doPost mit RequestBuilder
You're not setting the Content-Type of the request payload, and servlet containers generally only decode request payload that are explicitly identified as application/x-www-form-urlencoded. In your doPost, you should add a builder.setHeader(Content-Type, application/x-www-form-urlencoded) before the call to builder.sendRequest(). (and thanks a lot to the new Google Groups for offering an inline translation service !) -- 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-tool...@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: Refreshing reference message and eclipse extremely slow
Any news about this ? It really slows down development... What's the reason ? Is it client bundle or not ? Is there something which should not do to avoid this performance bug ? 9 peoples have starred it, so I'm not the only one. I've tried to find release note of the last version of Google plugin (1.4.2) but the release note page is not updated. With the last version of the plugin, the problem stays the same. 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-tool...@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: Modular rpc blues
I checked the content and I have the servlet tag in a the module descriptor ( Check the contents of the .jar file. Does it contain the module descriptor? Does the module descriptor contain servlet tags for the RPCs? ) I wonder if it is not a matter of gwt-maven-plugin version because the all sample compiles once and the version was 1.3-SNAPSHOT , if my memory is not failing then I had compilation problems ( not with thi project I think ) so I cleared my maven local repository then from this moment on It complained about 1.3-SNAPSHOT that could not be found so I changed to 2.1.0-1 this morning I reversed back to 1.3-SNAPSHOT : it compiles again ! an runs why not with 2.1.0-1 ? Thanks for reading Patrick - Original Message - From: Andreas Horst To: google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 6:55 PM Subject: Re: Modular rpc blues Don't worry. I know this is not a trivial but nonetheless vital aspect of efficient development of reusable GWT modules. I also think that these topics are not well documented, at least at the time I found myself struggling with GWT module inheritance (+ Maven). 2010/12/22 Coelho metronome.ba...@worldonline.fr I'll Check and let you know sorry for the trouble Patrick - Original Message - From: Andreas Horst To: google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 6:41 PM Subject: Re: Modular rpc blues Alright, now I get it! To bundle RPC functionality in a reusable (.jar) GWT module you only need to declare any RPC servlet in the module's module descriptor. That's all. gwt:mergewebxml will create appropriate servlet mappings in the target web.xml. It's really that easy. Make sure the .jar really contains the module descriptor (*.gwt.xml) and that the RPC servlets are actually declared in it. If you try it with a module that used to be an application and only declared its RPC servlets directly in its web.xml you won't be able to use them via gwt:mergewebxml AFAIK. Check the contents of the .jar file. Does it contain the module descriptor? Does the module descriptor contain servlet tags for the RPCs? 2010/12/22 Metronome / Basic metronome.ba...@worldonline.fr In fact I simply want to be able to use a jar containing GWT-RPC code in any webapp As I had no succes with my code I tried to rely on maven-googlewebtoolkit2-sample that is a HelloWorld RPC example with code in different modules. here is the parent pom I did'nt change the code , I just modified the poms - Original Message - From: Andreas Horst To: google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 1:52 PM Subject: Re: Modular rpc blues I just took a look at your configuration files. Actually I can't tell much from just them especially since I don't have the parent POM. Anyway I'm a bit confused about what you are trying to do. Are you only trying to compile the sample project or are you trying to reuse something of it? What exactly do you mean with project war rpc and server or war server? A project that packages to a .war file (like GWT applications) or a .war file you are trying to include via module inheritance? I'm sorry but it's really not clear to me. 2010/12/22 Metronome / Basic metronome.ba...@worldonline.fr Hello Thanks for trying to help me ! One of my tries is : compile the maven-googlewebtoolkit2-sample using gwt-maven-plugin it was a three modules project war rpc and server I reduced it to war server , by merging rpc and server I join the pom and web.xml of the war mvn package report ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.1.0-1:mergewebxml (default) on project maven-googlewebtoolkit2-sample-war: Unable to merge web..xml: NullPointerException - [Help 1] - Original Message - From: Andreas Horst To: google-web-toolkit@googlegroups.com Sent: Wednesday, December 22, 2010 12:26 AM Subject: Re: Modular rpc blues Another question just coming to my mind: Where in the inherited module are you declaring the RPC servlet? If you declare it in the inherited module's web.xml then make sure the Maven GWT plugin parameter webXml properly points to it (Not sure how one would do this - never did it myself - especially since inherited modules usually come as a .jar. If so does yours include the web.xml?). If you declare it in the inherited module's module descriptor (a..k.a.
Re: 2.1 MVP and handlers
On Thursday, December 23, 2010 3:38:12 AM UTC+1, sunny...@gmail.com wrote: Hi everyone, Before 2.1 I created an application that use the old MVP architecture of having models, views and presenters. This worked quite well. I'm migrating this application to use the 2.1 MVP framework now. I've made some progress but am still getting my head around it. This has hit me so far: in my old code, the presenter was responsible for setting the listeners/handlers on the view/eventbus respectively. Where appropriate handlers would be removed when the view changed so that events are not handled more than once. (eg, I destroy my login window once login succeeds, and I also remove the eventbus LoginSucceededEvent handler, so after logging out there aren't two of them listening on the eventbus) Here is the start method of the apps' login activity: @Override public void start(AcceptsOneWidget panel, EventBus eventBus) { LoginView view = clientFactory.getLoginView(); // just one instance bindView(view); // eg, view.getButton().addClickHandler(... bindEvents(view, eventBus); // eg, eventBus.addHandler( panel.setWidget(view.asWidget()); } The LoginView is reused from the ClientFactory as the documentation suggests. This raises two questions: 1) I would like to keep the GUI bindings outside the UI code (just as I did in the old code where it was in the presenter). But since the documentation suggests using a single instance of a the views, here I would be adding more and more listeners each time the activity is initialised (as they are in the ActivityMapper). The HelloMVP example has the binding code in the view and allows the view to communicate with the activity. Can this be avoided? It would help in keeping the UI code strictly to UI and presentation. Short of implementing a method on all views that clear its listeners I cannot think of a better way (I would still think this to be cumbersome - its not something you'd normally do) First, you have to understand the why of this suggestion: everything DOM-related is slow. This means that creating a view is slow (compared to creating any other POJO, such as your presenters/activities). Having initially worked with the HasXxxHandlers approach (MVP tutorial - part 1) and later switched to the delegates approach (quite some time before the MVP tutorial - part 2 and places activities tutorials were written), I assure you that writing unit tests is wy easier with the latter ! (I also find the presenter code more readable, and it allows using @UiHandler methods in your view if you use UiBinder). If you want to make the switch, I assure you you won't regret it. That being said, you're not forced to do the switch. If you want to keep your addXxxHandler calls in your presenter, then you'll have to remove them when the activity is over. This means keeping a reference to every HandlerRegistration returned by the addXxxHandler calls, and call removeHandler in each one from the onStop and onCancel methods of the activity. Someone posted (a few months back, maybe it was even last year) a HandlerRegistration holder, where you add your HandlerRegistration objects (e.g. holder.add(view.saveButton().addClickHandler(...)), so you only have a single call to holder.removeHandlers() in your onStop/onCancel. This is an approach that has been used by MVP frameworks such as gwt-mvp and gwt-platform too (but I don't think it's re-usable outside those frameworks). 2) Similar issue with eventbus handlers - I can't wrap the eventbus in a ResettableEventBus as I don't want to wipe all handlers off the eventbus, nor do I want to have to manually deal with each handler in onStop of the Activity. As Y2i said, this is actually not an issue as the EventBus you get passed in onStart *is* a ResettableEventBus. I don't understand why the ResettableEventBus is an issue for you though… (activities are meant to be thrown away once they're stopped/cancelled, they're specifically not meant to be re-used) -- 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-tool...@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: GWT Tomcat 404 error RPC www.domain.com
Your first link contains the path /domain therefore the RPC includes this path in its call. Your second call misses the path /domain. I guess www.domain.com/domain should work for you. You may make a redirect from www.domain.com to www.domain.com/ domain or redefine your servlet-mapping. Hope this helps you, Basdl On Dec 22, 6:32 am, kmemis memiske...@gmail.com wrote: Hi, I have successfully deployed a simple GWT RPC application to Tomcat server. When I tryhttp://my-public-ipaddress:8080/domainfrom my browser it successfully makes RPC . But when I callwww.domain.comit gets 404 error after RPC. Here is my Tomcat server configuration: Host name=www.domain.com appBase=webapps/domain unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false debug=1 Context path= docBase=. / Aliasdomain.com/Alias /Host What could be the problem? I looked at the packets from wireshark. While successful RPC browser sends POST with /domain/modulename/ service but during unsuccessful RPC it sends POST with /modulename/ service... -- 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-tool...@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: GWT Classpath to add new libraries
You can create a folder lib under your project's root and place the jar there. If you are using eclipse, Project - Build Path - Configure Build Path. Add the above lib under Libraries. Regards, Nirmal -- 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-tool...@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: How to force Spring to intercept RequestFactoryServlet
Thank you for your feedback and support on this. I spent a very long time, trying many different combinations, including those you suggested, unfortunately none of them worked. this topic was also discussed here, you can see my comments there. http://groups.google.com/group/google-web-toolkit/browse_thread/thread/20ea2aea53aa29d3 here is the log, showing whats going on ... http://paste.pocoo.org/show/308797/ based on your suggestion, I removed references to RequestFactoryServlet from web.xml and added this mapping to my webmvc-config.xml config file: bean class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping property name=mappings value/gwtRequest=gwtRequestFactoryController/value /property /bean bean id=gwtRequestFactoryController class=com.google.gwt.requestfactory.server.RequestFactoryServlet/ from the log file, it is clear that /gwtRequest is mapped. I also tried dozen of other combinations, but unfortunately no luck. still don't know why GWT RequestFactoryServlet behaves like this in Spring configured environment ? -- 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-tool...@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: GWT Classpath to add new libraries
Hi Nirmal Thank you for your help, now it works :D Regards, Roman On Dec 23, 11:00 am, Nirmal Patel nirmaljpa...@gmail.com wrote: You can create a folder lib under your project's root and place the jar there. If you are using eclipse, Project - Build Path - Configure Build Path. Add the above lib under Libraries. Regards, Nirmal -- 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-tool...@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: GWT Classpath to add new libraries
hi Nirmal Thank you for your help, now it works. :D Regards, Roman On Dec 23, 11:00 am, Nirmal Patel nirmaljpa...@gmail.com wrote: You can create a folder lib under your project's root and place the jar there. If you are using eclipse, Project - Build Path - Configure Build Path. Add the above lib under Libraries. Regards, Nirmal -- 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-tool...@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.
Weird EOF Exception while trying to download file from GWT application
Hi, I am trying to download a file from GWT client. At server side there is a servlet which generates content of file as per request and send it back to the client. Test Scenarios: Scenario 1 If I hit url of servlet directly, it always give me desired result without any problems. Scenario 2 Using GWT client on IE8,I am able to download file without any code changes. However on some other computer as soon as I try to write file content on response output stream, I get EOF exception. org.mortbay.jetty.EofException at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760) at org.mortbay.jetty.AbstractGenerator $Output.flush(AbstractGenerator.java:566) at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java: 911) at java.io.BufferedOutputStream.flush(Unknown Source) at.doGet(ServiceDataExporterServlet.java: 110) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java: 717)Creating input stream Code of servlet is as follows: try { output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE); byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int length; int bytesWritten=0; while ((length = data.read(buffer)) 0) { bytesWritten+=length; output.write(buffer, 0, length); } output.flush() // At this point I am facing EOF exception. where data is inputStream Via means of bytesWritten variable I have confirmed that in all the three scenarios content has been written in the same way in output stream. But not sure why it is not working in some computers. Any pointers will be highly appereciated. -- 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-tool...@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: requestfactory: server side query using JPQL
yes of course, without where i can get all person object with address is null and not null. -- 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-tool...@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: Modular rpc blues
Good job, Patrick! We're still using 1.3-SNAPSHOT ourself so I even wouldn't have been able to solve the problem. I guess I'll think it over more than twice before switching to newer versions. Anyway I'll leave a message as soon as I try it myself with 2.1.0-1. Until then maybe someone else could join who is already using 2.1.0-1. Sorry I couldn't help. 2010/12/23 Coelho metronome.ba...@worldonline.fr I checked the content and I have the servlet tag in a the module descriptor ( Check the contents of the .jar file. Does it contain the module descriptor? Does the module descriptor contain servlet tags for the RPCs? ) I wonder if it is not a matter of gwt-maven-plugin version because the all sample compiles once and the version was 1.3-SNAPSHOT , if my memory is not failing then I had compilation problems ( not with thi project I think ) so I cleared my maven local repository then from this moment on It complained about 1.3-SNAPSHOT that could not be found so I changed to 2.1.0-1 this morning I reversed back to 1.3-SNAPSHOT : it compiles again ! an runs why not with 2.1.0-1 ? Thanks for reading Patrick - Original Message - *From:* Andreas Horst horst.andrea...@googlemail.com *To:* google-web-toolkit@googlegroups.com *Sent:* Wednesday, December 22, 2010 6:55 PM *Subject:* Re: Modular rpc blues Don't worry. I know this is not a trivial but nonetheless vital aspect of efficient development of reusable GWT modules. I also think that these topics are not well documented, at least at the time I found myself struggling with GWT module inheritance (+ Maven). 2010/12/22 Coelho metronome.ba...@worldonline.fr I'll Check and let you know sorry for the trouble Patrick - Original Message - *From:* Andreas Horst horst.andrea...@googlemail.com *To:* google-web-toolkit@googlegroups.com *Sent:* Wednesday, December 22, 2010 6:41 PM *Subject:* Re: Modular rpc blues Alright, now I get it! To bundle RPC functionality in a reusable (.jar) GWT module you only need to declare any RPC servlet in the module's module descriptor. That's all. gwt:mergewebxml will create appropriate servlet mappings in the target web.xml. It's really that easy. Make sure the .jar really contains the module descriptor (*.gwt.xml) and that the RPC servlets are actually declared in it. If you try it with a module that used to be an application and only declared its RPC servlets directly in its web.xml you won't be able to use them via gwt:mergewebxml AFAIK. Check the contents of the .jar file. Does it contain the module descriptor? Does the module descriptor contain servlet tags for the RPCs? 2010/12/22 Metronome / Basic metronome.ba...@worldonline.fr In fact I simply want to be able to use a jar containing GWT-RPC code in any webapp As I had no succes with my code I tried to rely on maven-googlewebtoolkit2-sample that is a HelloWorld RPC example with code in different modules. here is the parent pom I did'nt change the code , I just modified the poms - Original Message - *From:* Andreas Horst horst.andrea...@googlemail.com *To:* google-web-toolkit@googlegroups.com *Sent:* Wednesday, December 22, 2010 1:52 PM *Subject:* Re: Modular rpc blues I just took a look at your configuration files. Actually I can't tell much from just them especially since I don't have the parent POM. Anyway I'm a bit confused about what you are trying to do. Are you only trying to compile the sample project or are you trying to reuse something of it? What exactly do you mean with project war rpc and server or war server? A project that packages to a .war file (like GWT applications) or a .war file you are trying to include via module inheritance? I'm sorry but it's really not clear to me. 2010/12/22 Metronome / Basic metronome.ba...@worldonline.fr Hello Thanks for trying to help me ! One of my tries is : compile the maven-googlewebtoolkit2-sample using gwt-maven-plugin it was a three modules project war rpc and server I reduced it to war server , by merging rpc and server I join the pom and web.xml of the war mvn package report ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.1.0-1:mergewebxml (default) on project maven-googlewebtoolkit2-sample-war: Unable to merge web..xml: NullPointerException - [Help 1] - Original Message - *From:* Andreas Horst horst.andrea...@googlemail.com *To:* google-web-toolkit@googlegroups.com *Sent:* Wednesday, December 22, 2010 12:26 AM *Subject:* Re: Modular rpc blues Another question just coming to my mind: Where in the inherited module are you declaring the RPC servlet? If you declare it in the inherited module's web.xml then make sure the Maven GWT plugin parameter webXml properly points to it (Not sure how one would do this - never did it myself - especially since inherited modules usually come as a .jar. If so does
Re: Centering an image in a SimplePanel
I found a workaround, I used an horizontal panel containing one element and played with setVerticalAlignment/setHorizontalAlignment in the code. It works, but it is not 'clean'. If anyone knows a better solution, let me know. Thanks. On Dec 22, 11:41 pm, UseTheFork jvers...@gmail.com wrote: I forgot to mention: I use Uibinder. -- 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-tool...@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: json gwt
Yes, I make configured for servlet servlet servlet-nameJSONServlet/servlet-name servlet-classcom.trackstudio.JSONServlet/servlet-class /servlet servlet-mapping servlet-nameJSONServlet/servlet-name url-pattern/JSONServlet/url-pattern /servlet-mapping When I set this link in browser I get json objects On Dec 23, 6:39 am, zixzigma zixzi...@gmail.com wrote: have you configured your servlet in web.xml file ? -- 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-tool...@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: json gwt
Can you give example used Javascript Overlay? On Dec 23, 6:49 am, Subhrajyoti Moitra subhrajyo...@gmail.com wrote: adding to the above. - Fix an UncaughtExceptioHandler to see if there are exceptions that are not being handled. - Use Gson to construct and deconstruct JSON in to POJO and vice versa. u can avoid the manual step in your servlet. - On the client use Javascript Overlay types to read the server response and process it. - Make sure your client and server are running on the same host, other wise u will need to use the cross-site compiler for client code and JSONP at the server to send responses back. HTH. Thanks, Subhro. On Thu, Dec 23, 2010 at 9:09 AM, zixzigma zixzi...@gmail.com wrote: have you configured your servlet in web.xml file ? -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@googlegroups.com . 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 google-web-tool...@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.
Compressing JSON?
My application uses .NET C# on the server side and GWT on the client side/UI. I use JSON to interchange data between the UI and the server and the server application is served by IIS 7. There are situations when my JSON gets bigger and it causes a delay in UI display. Is there a way that I can compress/decompress JSON and would that be any helpful? -- 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-tool...@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.
Is GWT MVP Appropriate For Modeless Application?
After implementing onUnload to remove event handlers (which worked, of course) I realized that this approach is inappropriate for my application. The reason is that my application is basically modeless - meaning that I can remove a widget from the dom and hold onto the widget object via a reference, replace the widget in the dom with another widget and at some future time restore the widget that I removed. Here's a use case for such a scenario: Composite A which is a singleton is created and once attached to the dom it will remain attached for the lifetime of the application. Composite A is a view of a list of data models and when the user selects a data model to edit from the list Composite A hides itself and then shows a sub view which is Composite B that allows editing of the data model's attributes. Composite B has numerous list box widgets that contain values that can be created from other Compsosite views in the application. At some point the user needs to select a value from one of these list boxes but the value doesn't exist so the user switches to a different view, Compsite Z, which replaces Composite A by removing it from the dom and inserting itself into the dom. While in Composite Z's view the user adds a new value. Once she saves the value Composite Z will fire off an event notifying that a new value now exists which Composite B handles even though at the time it handles the event it is not attached to the dom. The user then switches back to view Composite B which replaces Composite Z by removing it from the dom and adding itself back to the dom and in the list box the user now sees the new value which Composite B added to it when it handled the event that Composite Z had fired. As the above use case demonstrates, my application is extremely modeless and is very similar to a desktop application in that regard. In order to get onUnload to work for my use case required that Composite B check a boolen attribute which is only set to true when the user actually closes Composite B which sets the boolean to true and if true actually calls removeHandler. Do you think the current GWT implementation of MVP would be appropriate - meaning would it be able to handle my use case of using modeless views as described above? Thanks in advance, Jeff -- *Jeff Schwartz* -- 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-tool...@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: Centering an image in a SimplePanel
If you were using pure css to do this your outer container, a div, would have a width and the inner element, in this case an image, would set its left and right margins to auto causing the image to be vertically centered within its outer container. Try implementing the above using GWT semantics and it will work. If you are using UiBinder this is easy because you can attach the styles directly to your HTML tags either as styles or classes. On Thu, Dec 23, 2010 at 7:03 AM, UseTheFork jvers...@gmail.com wrote: I found a workaround, I used an horizontal panel containing one element and played with setVerticalAlignment/setHorizontalAlignment in the code. It works, but it is not 'clean'. If anyone knows a better solution, let me know. Thanks. On Dec 22, 11:41 pm, UseTheFork jvers...@gmail.com wrote: I forgot to mention: I use Uibinder. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- *Jeff Schwartz* -- 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-tool...@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: Compressing JSON?
Are you sure that you have to transfer such amount of data to your client ? Have you considered some kind of data separation or maybe some pagination technique ? If you are returning so much data, this means that your users have to look into that data, which in most cases takes a lot of time. On 12/23/2010 02:40 PM, shahid wrote: My application uses .NET C# on the server side and GWT on the client side/UI. I use JSON to interchange data between the UI and the server and the server application is served by IIS 7. There are situations when my JSON gets bigger and it causes a delay in UI display. Is there a way that I can compress/decompress JSON and would that be any helpful? -- 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-tool...@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: Compressing JSON?
Well I agree with mgenov. For tables and lists you should really consider only transferring data which is actually displayed. However sometimes this is not possible. For example in one of my applications I have to display around 50.000 dots in a 5 different scatterplots. My backend (cherrypy, python webserver) creates a google visualization datatable (json array) which is passed to my GWT application. The response of this json array is around 330 kb in size. It's acutally fast enough to display it quickly. However by enabling gzip compression on the webserver I could reduce the response size from 330 kb to around 110 kb. That's actually quite significant. For these kind of use cases I definitely recommend to activate gzip compression on the server. -- 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-tool...@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: Compressing JSON?
I agree and I do have pagination where I can possibly do so. The problem arise when I have for example a large form with data that should be populated in or the amount of data I am displaying on one screen itself is big enough e.g. in the case of showing trend data over a period of 4 weeks for example. On Dec 23, 1:40 pm, ?mit uemit.se...@gmail.com wrote: Well I agree with mgenov. For tables and lists you should really consider only transferring data which is actually displayed. However sometimes this is not possible. For example in one of my applications I have to display around 50.000 dots in a 5 different scatterplots. My backend (cherrypy, python webserver) creates a google visualization datatable (json array) which is passed to my GWT application. The response of this json array is around 330 kb in size. It's acutally fast enough to display it quickly. However by enabling gzip compression on the webserver I could reduce the response size from 330 kb to around 110 kb. That's actually quite significant. For these kind of use cases I definitely recommend to activate gzip compression on the server. -- 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-tool...@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: Compressing JSON?
Why you have to render trend on the client side ? You probably could ask the server to render graphic as image, then you could render it using Image widget ? This is just an idea, I don't know whether this is possible in your case. -- 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-tool...@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: gzippen all gwt output files?
I am using the PreCompress linker now, but have problems precompressing my xml files. I added this line: extend-configuration-property name='precompress.path.regexes' value='.*\.xml' / As I want it to compress my static XML cms files, but it doesn't compress them. Might this because it only compress generated files ?... My static content is located in the war dir and I use the maven gwt plugin for gwt compilation. -- 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-tool...@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: json gwt
On Wednesday, December 22, 2010 2:46:36 PM UTC+1, Petr Arsentev wrote: String url = http://localhost:8080/JSONServlet;; RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url); Same Origin Policy ? What does url=/JSONServlet give ? Just in case, see http://code.google.com/webtoolkit/doc/latest/FAQ_Server.html#What_is_the_Same_Origin_Policy,_and_how_does_it_affect_GWT? and http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#How_do_I_use_my_own_server_in_development_mode_instead_of_GWT's -- 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-tool...@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.
Confused about Servlet mapping and Url Pattern, RPC not working when Deployed
I have implemneted the example Stock Watcher application, i am trying to deploy the example in Apache Tomcat 5.5. After downloading the example from GWT @ http://code.google.com/webtoolkit/doc/trunk/tutorial/RPC.html, and implementing GWT RPC according to the tutorial: I haven't come across setting the servlet mapping in the Tutotrial. After deploying in Apache Tomcat 5.5, only my client side code is running and its not connecting to the server side. After reading this from the tutorial If your web pages display but the RPC calls don't seem to be going through, try turning on access logging on Tomcat. You may find that the URL used by the client side has not been registered by Tomcat, or that there is a misconfiguration between the URL path set in the setServiceEntryPoint(URL) call when declaring your RPC service and the url-pattern URL mapping the the web.xml file. Now i think i have a misconfiguration between the setting in setServiceEntryPoint and url-pattern. Below are the entries of the Gwt.Xml and Web.xml: Gwt.Xml: entry-point class='com.google.gwt.sample.stockwatcher.client.StockWatcher'/ Web.Xml: servlet-mapping servlet-namestockPriceServiceImpl/servlet-name url-pattern/stockwatcher/stockPrices/url-pattern /servlet-mapping and the StockPriceService.java: @RemoteServiceRelativePath(stockPrices) Can any one tell me what should i do now to do a Url mapping so the RPC call will be going through. -- 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-tool...@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: gzippen all gwt output files?
Yes, only generated files are compressed (this includes static resources though, as long as they come from a public path in a compiled GWT module, i.e. a theme's CSS). -- 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-tool...@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: Weird EOF Exception while trying to download file from GWT application
I know this sounds crazy but in the past I've run into this and this seemed to fixed the problem... ... OutputStream os; try { os = response.getOutputStream(), BufferedOutputStream output = new BufferedOutputStream(os, DEFAULT_BUFFER_SIZE); ... } if (os != null) os.flush(); Also, have you tried wrapping the flush() in a try catch and ignore the thrown exception? On Dec 23, 5:13 am, tarun aloneparrot...@gmail.com wrote: Hi, I am trying to download a file from GWT client. At server side there is a servlet which generates content of file as per request and send it back to the client. Test Scenarios: Scenario 1 If I hit url of servlet directly, it always give me desired result without any problems. Scenario 2 Using GWT client on IE8,I am able to download file without any code changes. However on some other computer as soon as I try to write file content on response output stream, I get EOF exception. org.mortbay.jetty.EofException at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760) at org.mortbay.jetty.AbstractGenerator $Output.flush(AbstractGenerator.java:566) at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java: 911) at java.io.BufferedOutputStream.flush(Unknown Source) at.doGet(ServiceDataExporterServlet.java: 110) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java: 717)Creating input stream Code of servlet is as follows: try { output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE); byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int length; int bytesWritten=0; while ((length = data.read(buffer)) 0) { bytesWritten+=length; output.write(buffer, 0, length);} output.flush() // At this point I am facing EOF exception. where data is inputStream Via means of bytesWritten variable I have confirmed that in all the three scenarios content has been written in the same way in output stream. But not sure why it is not working in some computers. Any pointers will be highly appereciated. -- 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-tool...@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.
HTML5 placeholder
Hi, I was wondering there is a way to add an HTML5 attribute like placeholder to a text input tag within UIBinder or doing so otherwise in normal Java code. 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-tool...@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: HTML5 placeholder
You could call setAttribute on the UiField. This would look like the following: yourField.getElement().setAttribute(placeHolder,content of placeholder); Daniel On Thu, Dec 23, 2010 at 8:41 AM, alexh alexanderhar...@gmail.com wrote: Hi, I was wondering there is a way to add an HTML5 attribute like placeholder to a text input tag within UIBinder or doing so otherwise in normal Java code. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . 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 google-web-tool...@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: json gwt
Link url=/JSONServlet give just text {'data':'test'} But I change code: @Override public void onResponseReceived(Request request, Response response) { Window.alert(response.getStatusCode() + +response.getStatusText() + + response.getText()); } and now I have exception ERROR: Uncaught exception escaped. com.google.gwt.core.client.JavaScriptException: (NS_ERROR_NOT_AVAILABLE): Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.statusText] QueryInterface: function QueryInterface() { [native code] } result: 2147746065 filename: http://127.0.0.1: lineNumber: 98 columnNumber: 0 inner: null data: null initialize: function initialize() { [native code] } What is problem? On Dec 23, 5:36 pm, Thomas Broyer t.bro...@gmail.com wrote: On Wednesday, December 22, 2010 2:46:36 PM UTC+1, Petr Arsentev wrote: String url = http://localhost:8080/JSONServlet;; RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url); Same Origin Policy ? What does url=/JSONServlet give ? Just in case, seehttp://code.google.com/webtoolkit/doc/latest/FAQ_Server.html#What_is_... andhttp://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebu... -- 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-tool...@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: HTML5 placeholder
I'd rather use setPropertyString though, given that there's a property reflecting the attribute: yourField.getElement().setPropertyString(placeholder, content of placeholder); (i.e. in JS, you'll more likely write myInputText.placeholder=content of placeholder than myInputText.setAttribute(placeholder, content of placeholder)) -- 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-tool...@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: HTML5 placeholder
I created a simple subclass so that I can use the placeholder property in UIBinder: public class PlaceholderTextBox extends TextBox { public void setPlaceholder(String placeholder) { InputElement inputElement = getElement().cast(); inputElement.setAttribute(placeholder, placeholder); } } - Harald -- 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-tool...@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: json gwt
This is likely the sign of an SOP issue (127.0.0.1: and localhost:8080 are not the same origin: 127.0.01 != locahost, *and* != 8080) (note that by url=/JSONServlet I really meant replacing the value of the 'url' variable in your code) -- 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-tool...@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: json gwt
But when I use outsite resource String url = http://gdata.youtube.com/ feeds/api/users/bogleg/uploads?alt=json-in-scriptcallback=1; it is work correct. On Dec 23, 6:22 pm, Thomas Broyer t.bro...@gmail.com wrote: This is likely the sign of an SOP issue (127.0.0.1: and localhost:8080 are not the same origin: 127.0.01 != locahost, *and* != 8080) (note that by url=/JSONServlet I really meant replacing the value of the 'url' variable in your code) -- 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-tool...@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: HTML5 placeholder
I tried a test using setPropertyString, and cannot get it to work. Am I wrong in thinking that 'this[name] = value;' is not useful in this case b/c placeHolder should be an actual element attribute rather than a property that is referenced in js? Daniel On Thu, Dec 23, 2010 at 9:12 AM, Thomas Broyer t.bro...@gmail.com wrote: I'd rather use setPropertyString though, given that there's a property reflecting the attribute: yourField.getElement().setPropertyString(placeholder, content of placeholder); (i.e. in JS, you'll more likely write myInputText.placeholder=content of placeholder than myInputText.setAttribute(placeholder, content of placeholder)) -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . 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 google-web-tool...@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: HTML5 placeholder
Works for me (tested in Chrome 10-dev using the Web inspector's JS console), but it has to be placeholder with a lower-case h, not placeHolder. -- 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-tool...@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: GWT and HTML5 Client-side Storage
Is there any plan to support client-side storage in GWT directly (I mean without third party libraries)? -- 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-tool...@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: json gwt
Because gdata.youtube.com explicitly allows it using CORS: http://www.w3.org/TR/cors/ which most browser implement (all recent versions of any browser except IE) -- 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-tool...@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: GWT 2.1 MVP Multiple activities clarification help
As an exercise I've build a little POC based on the concepts expressed by Thomas in his article. If someone is interested, the sources are here: http://95.110.143.4/layoutmvp/layoutmvp.tar.gz and here you can find a live demo: http://95.110.143.4/layoutmvp/layoutmvp.html -- 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-tool...@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: Confused about Servlet mapping and Url Pattern, RPC not working when Deployed
Hello Nirmal, Sorry for reposting again, i am confused so i reposted it again. As you said i am pasting ym GWT.Xml and Web.Xml here, StockWatcher.gwt.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 1.6.2// EN http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro- source/core/src/gwt-module.dtd module rename-to='stockwatcher' inherits name='com.google.gwt.user.User'/ inherits name='com.google.gwt.rpc.RPC'/ entry-point class='com.google.gwt.sample.stockwatcher.client.StockWatcher'/ servlet path='/stockPrices' class='com.google.gwt.sample.dynatable.server.StockPriceServiceImpl' / /module web.Xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-namestockPriceServiceImpl/servlet-name servlet- classcom.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl/ servlet-class /servlet servlet-mapping servlet-namestockPriceServiceImpl/servlet-name url-pattern/stockwatcher/stockPrices/url-pattern /servlet-mapping /web-app My remote servlet path is the same -- StockPriceService.java: @RemoteServiceRelativePath(stockPrices) This is what i have in Tomcat: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher -- contains my .css, .gwt.xml, .html C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\stockwatcher -- contains the .cache, gwt folder and .nocache.js C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\WEB-INF -- contains classes, lib and web.xml and C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\client C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\server -- these contain the actual jave files(source files) i dont think i need these. I have turned on access logging on Tomcat: This is the error on localhost_access_log 127.0.0.1 - - [23/Dec/2010:10:44:14 -0500] GET /stockwatcher/ stockwatcher/stockwatcher.nocache.js HTTP/1.1 200 5548 127.0.0.1 - - [23/Dec/2010:10:44:14 -0500] GET /stockwatcher/ stockwatcher/07CFDAF5832B06D1C2CA4E468883DC49.cache.html HTTP/1.1 200 91481 if i reload the whole page again 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ StockWatcher.html HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ StockWatcher.css HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/stockwatcher.nocache.js HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/07CFDAF5832B06D1C2CA4E468883DC49.cache.html HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/gwt/standard/standard.css HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/gwt/standard/images/hborder.png HTTP/1.1 304 - If you need any information let me know. Am i doing something wrong, are my tomcat deployed folders correct? -- 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-tool...@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.
EnterButton
I have a couple of places where I want the user to be able to hit enter, and have a button clicked. So I created the class EnterButton, which has all the default constructors, and the following bit of code: public void onKeyPress (KeyPressEvent event) { int keyCode = event.getNativeEvent ().getKeyCode (); if (keyCode == KeyCodes.KEY_ENTER) click (); } Is there a reason why some such class isn't part of GWT already? Is there something in this code that will turn around and bite me in the tush? -- 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-tool...@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: json gwt
Thomas Broyer Thank very much ) It is works! -- 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-tool...@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: requestfactory: server side query using JPQL
Have you tried @JoinColumn(name=AddressID, nullable=true) instead of @Column(name=AddressID) On Dec 23, 2:56 am, Mike gsun...@gmail.com wrote: yes of course, without where i can get all person object with address is null and not null. -- 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-tool...@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.
Where do KeyPress Events go?
So, now that I have an EnterButton class, I'd like to use it. :-) I have a form panel with a FileUpload. I'd like to let the user select a file, then hit enter to fire the form submit button (which is an EnterButton, not a SubmitButton). Unfortunately, FileUpload does not have an addKeyPressHandler routine. So, who gets any key events I generate while in the text field part of a FileUpload? What is the call chain for events that aren't captured by the Widget where the event happens? Sorry if this is an FAQ, and in the docs. I took a (quick) look, and couldn't find anything. Please point me to the correct docs if it is in there. Thanks! Greg -- 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-tool...@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: Flextable with a locked in position header row despite scrolling
Thank you so much. I think using standard Flextable the way it is used in the Email application is suitable for me. I dont want to use any components from incubator which might be deprecated or removed in the future. - Sunit Katkar http://sunitkatkar.blogspot.com/ On Wed, Dec 22, 2010 at 2:16 PM, ciosbel andrew...@gmail.com wrote: The simplest thing (keeping you original idea) is to use a flextable for the header and a flextable (with no header) for the content. See for example http://gwt.google.com/samples/Mail/Mail.html Code http://code.google.com/p/google-web-toolkit/source/browse/tags/2.1.1/samples/mail/src/com/google/gwt/sample/mail/client/MailList.ui.xml?r=9478 Maybe you can even still use one flextable and play around with fixed positioning of the first row, but its hacky. But it's a dummy example, if you need to interact or simply manage displayed content (paging/caching/...) i suggest to use a different widget, like CellTable (http://gwt.google.com/samples/Showcase/Showcase.html#! CwCellTable) or PagingScrollTable from the incubator suite (http:// collectionofdemos.appspot.com/demo/ com.google.gwt.gen2.demo.scrolltable.PagingScrollTableDemo/ PagingScrollTableDemo.html) The latter will be supressed in a future release of gwt, so keep it in mind. ciosbel. On 22 Dic, 22:56, Sunit Katkar sunitkat...@gmail.com wrote: I have a flextable. Its inside a scrollpanel because the number of rows is more than what can be shown at a time. So user has to scroll up and down to view all contents. Now is there a way where I can keep the header row locked in its original position while rest of the rows are scrolled up and down? I have seen such tables with some javascript widgets, and I think in SmartGWT too. However, I want to do this with GWT. Is it possible? Any hints? - Sunit Katkarhttp://sunitkatkar.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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . 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 google-web-tool...@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.
ValueProxy example
I've got embedded objects within my entities and it appears as though ValueProxy is just what I need. When I tried it out, my values are always null. I verified the server-side is retrieving these embedded values but I'm very new to RequestFactory so I'm sure I did something wrong wiring things up. Are there any working examples of ValueProxy I can follow? JR -- 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-tool...@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.
Custom Map and relative Projection
Hi, I want to create my custom Map using Google Maps 1.1 Library. I've a little problem... If I use the Mercator Projection class, my custom map repeat itself continuously in the x space... There's a way to see my map once (without repetitions)? -- 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-tool...@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: doPost mit RequestBuilder
Thank you Thomas, but with builder.setHeader(Content-Type, application/x-www-form- urlencoded) ; the servlet receives NO request :(. If I comment this, the servlet gains the request with null Parameters. Sorry. On 23 Dez., 10:28, Thomas Broyer t.bro...@gmail.com wrote: You're not setting the Content-Type of the request payload, and servlet containers generally only decode request payload that are explicitly identified as application/x-www-form-urlencoded. In your doPost, you should add a builder.setHeader(Content-Type, application/x-www-form-urlencoded) before the call to builder.sendRequest(). (and thanks a lot to the new Google Groups for offering an inline translation service !) -- 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-tool...@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: How to force Spring to intercept RequestFactoryServlet
I wish I could help more but I don't use RequestFactory so I don't have a Spring configuration with it:( On Dec 23, 5:03 am, zixzigma zixzi...@gmail.com wrote: Thank you for your feedback and support on this. I spent a very long time, trying many different combinations, including those you suggested, unfortunately none of them worked. this topic was also discussed here, you can see my comments there.http://groups.google.com/group/google-web-toolkit/browse_thread/threa... here is the log, showing whats going on ...http://paste.pocoo.org/show/308797/ based on your suggestion, I removed references to RequestFactoryServlet from web.xml and added this mapping to my webmvc-config.xml config file: bean class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping property name=mappings value/gwtRequest=gwtRequestFactoryController/value /property /bean bean id=gwtRequestFactoryController class=com.google.gwt.requestfactory.server.RequestFactoryServlet/ from the log file, it is clear that /gwtRequest is mapped. I also tried dozen of other combinations, but unfortunately no luck. still don't know why GWT RequestFactoryServlet behaves like this in Spring configured environment ? -- 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-tool...@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: json gwt
Petr, What did you do to make it work ? -- 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-tool...@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: How to add column titles for widget CellBrowser?
I opened an issue related to column headers in the CellBrowser http://code.google.com/p/google-web-toolkit/issues/detail?id=5809 Please add your stars if you are interested the header support. On Dec 22, 10:45 am, Y2i yur...@gmail.com wrote: I would also be interested to learn how to add headers toCellBrowser columns without adding dummy header data items inside sub-classes of the AbstractDataProvider. Thank you in advance. On Nov 26, 5:30 am, Łukasz Bachman lukaszbach...@gmail.com wrote: Hi guys, we are struggling with adding some header toCellBrowser. There is nothing in API which would support that, also we did try extending baseCellBrowserto get our hands on some protected content but no luck there either. Did anyone manage to find the solution? Regards, Łukasz -- 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-tool...@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: Compressing JSON?
Just add handler to IIS 7 that will do gzip-compression, and browsers will automatically uncompress upon receiving. May be your UI getting slow because of other reasons then waiting for JSON? Try to use Speed Tracer (http://code.google.com/intl/uk-UA/ webtoolkit/speedtracer/) to investigate lag reason. -- 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-tool...@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: ValueProxy example
Even though they're not really relationships, they probably (I haven't yet checked) obey the same rules: http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html#relationships When querying the server, RequestFactory does not automatically populate relations in the object graph. To do this, use the with() method on a request and specify the related property name as a String: Request findReq = requestFactory.personRequest().find(personId).with(address); -- 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-tool...@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: gzippen all gwt output files?
Where do you put your static (not gwt) resources (css/images/js not part of clientbundles) ? I like putting them in the war folder (war/resources) and thought the public folder usage was a bit deprecated :( -- 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-tool...@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: GWT 2.1.1 RequestFactory Strange Exception
from your explanation I get the feeling that Locators are DAOs, is this correct ? placing calls like these: EntityManager#find(clazz,id) inside a Locator, means Locator is now responsible for accessing datastore to perform actions. it also means that our DAOs are somehow directly coupled with RequestFactoryServlet. A common design approach is to have a Service Layer and a DataAccessLayer, that communicate through interfaces. when the request comes from the client, it gets routed to the Service object responsible for performing a business logic to fulfill clients request. In doing so, the Service object, may interact with a number of DAOs, to perform the task. and if Required, this Service object returns the data that has to be given to the client. in GWT 2.1.1 RequestFactory Servlet, ServiceLocator can be used to locate the Service Object responsible for fulfilling client request. However, how the ServiceObject communicates with server-side DAO to get its data is the ServiceObject concern, not the RequestFactoryServlet. In otherwords, our Service Object itself knows how to locate DAOs, therefore why do we need this Locator for our EntityObjects ? On Dec 22, 2:19 am, Thomas Broyer t.bro...@gmail.com wrote: Well, as always, it depends what you need and what you can do. If you can implement a single Locator class that works for all your entities, then go with it; and otherwise make one for each entity. For instance, if you have a base class for your entities that provides an ID and version, then you can easily cast any entity to that class to implement getId and getVersion, and you probably can implement getIdType by returning a fixed type. You can clazz.newInstance() in the create() or use PersistenceManager#newInstace with JDO. And you can easily find using the Class and ID with JPA using EntityManager#find(clazz,id), or with JDO using PersistenceManager#getObjectById(clazz,id). -- 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-tool...@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: gzippen all gwt output files?
The public path allows for reuse (as for themes). In that sense, its not deprecate. Otherwise, yes, you'll put them in the war, but then you're responsible for them (and thus for compressing them) -- 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-tool...@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: Confused about Servlet mapping and Url Pattern, RPC not working when Deployed
Hello Nirmal, I have some questions (please also look for my above post and reply for it too) From the StockWatcher application project, after i compile i have StockPriceServiceImpl.class, this means my server side code is compiled right? or do i have to do to the non eclipse method and build my war file using ant build and then use those files. Right now i am going through everything using these steps http:// code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web- toolkit-doc-1-5t=DevGuideRPCDeployment, will let you know how it went!! On Dec 23, 11:33 am, AmaraSat amara.forthewo...@gmail.com wrote: Hello Nirmal, Sorry for reposting again, i am confused so i reposted it again. As you said i am pasting ym GWT.Xml and Web.Xml here, StockWatcher.gwt.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 1.6.2// EN http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro- source/core/src/gwt-module.dtd module rename-to='stockwatcher' inherits name='com.google.gwt.user.User'/ inherits name='com.google.gwt.rpc.RPC'/ entry-point class='com.google.gwt.sample.stockwatcher.client.StockWatcher'/ servlet path='/stockPrices' class='com.google.gwt.sample.dynatable.server.StockPriceServiceImpl' / /module web.Xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-namestockPriceServiceImpl/servlet-name servlet- classcom.google.gwt.sample.stockwatcher.server.StockPriceServiceImpl/ servlet-class /servlet servlet-mapping servlet-namestockPriceServiceImpl/servlet-name url-pattern/stockwatcher/stockPrices/url-pattern /servlet-mapping /web-app My remote servlet path is the same -- StockPriceService.java: @RemoteServiceRelativePath(stockPrices) This is what i have in Tomcat: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher -- contains my .css, .gwt.xml, .html C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\stockwatcher -- contains the .cache, gwt folder and .nocache.js C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\WEB-INF -- contains classes, lib and web.xml and C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\client C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps \stockwatcher\server -- these contain the actual jave files(source files) i dont think i need these. I have turned on access logging on Tomcat: This is the error on localhost_access_log 127.0.0.1 - - [23/Dec/2010:10:44:14 -0500] GET /stockwatcher/ stockwatcher/stockwatcher.nocache.js HTTP/1.1 200 5548 127.0.0.1 - - [23/Dec/2010:10:44:14 -0500] GET /stockwatcher/ stockwatcher/07CFDAF5832B06D1C2CA4E468883DC49.cache.html HTTP/1.1 200 91481 if i reload the whole page again 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ StockWatcher.html HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ StockWatcher.css HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/stockwatcher.nocache.js HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/07CFDAF5832B06D1C2CA4E468883DC49.cache.html HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/gwt/standard/standard.css HTTP/1.1 304 - 127.0.0.1 - - [23/Dec/2010:11:13:33 -0500] GET /stockwatcher/ stockwatcher/gwt/standard/images/hborder.png HTTP/1.1 304 - If you need any information let me know. Am i doing something wrong, are my tomcat deployed folders correct? -- 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-tool...@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: GWT 2.1.1 RequestFactory Strange Exception
RequestFactory sends diffs on the wire (client-to-server), so how would your Service Object (as you call it) would receive a complete domain object if the diff isn't applied to an object retrieved from the database/datastore? Things are a bit more blury than service layer on top of data access layer. If you want to name things, RequestFactoryServlet is part of your service layer, and delegates a few (a very few) things to DAOs (Locator, or static findXxx methods), and all the business logic to other pieces (services, as referenced in @Service/@ServiceName, or instance methods on your domain objects) (as for the SL vs. DAL, I never bought that; the few times I used that strict approach, one was almost useless; JPA/JDO/whatever *are* the DAL, you hardly need an additional layer, and each layer removes some ways of optimizing things, notably database/datastore requests; but that's another debate) -- 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-tool...@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: gzippen all gwt output files?
Thanks, I used to the public folder in the past but didn't like it in reusable components as you always got the public resources in your project when using the reusable component, even if you didn't use or want them :(... Where do you put your static resources ? Another thing: I am not sure if MultiViews it the way to use it on Apache as MultiViews is used for language negotiation (as I understand it) and means that the requested file should not be present, but it should be present with an extension. For example: Request: bla.nocache.js the file bla.nocache.js is not allowed to be present on the server. If this file is present, it will not look for any better (gz) version, and directly return this file. What should be present for example: bla.nocache.js.en bla.nocache.js.gz.en Then it will return the file that best meets the browser properties, such that it will return bla.nocache.js.gz.en. I got this working with the following config for a directory section in Apache: Options +MultiViews AddEncoding x-gzip .gz .tgz AddLanguage en .en But that means that I have to rename all files to have a language extension :(.. Which is not really the path I want to go in to. Do I overlook something, or is this really the way to go? See also: http://www.w3.org/International/questions/qa-apache-lang-neg -- 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-tool...@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.
Is selectionModel.setSelected asynchronous?
Hello I'm trying to clear selection on a list that has selectionChangeHandler attached to it. This fires a new event that triggers the handler again. I'd like to ignore the event that has been triggered as result of me clearing the selection. The problem is that there seems to be stuff happening asynchronously. new SelectionChangeEvent.Handler() { boolean muted = false; @SuppressWarnings(unchecked) @Override public void onSelectionChange(SelectionChangeEvent event) { if(muted) return; NoSelectionModelUser selectionModel = (NoSelectionModelUser) event.getSource(); User user = selectionModel.getLastSelectedObject(); // ... muted = true; // I'd expect the following line to launch onSelectionChange again, with muted=true selectionModel.setSelected(user, false); // instead following one gets evaluated muted = false; // and the handler gets triggered after that, obviously with muted=false again :( } } I could check whether the user is null and return out of the handler but I don't like that kind of workaround because null selection != invalid selection; and (more importantly) this ?async? evaluation does not seem right... What am I missing please? J. Záruba -- 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-tool...@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: GWT 2.1.1 RequestFactory Strange Exception
Thank you so much for your feedback on this. I am going to experiment more, using your guidelines. as for the need for additional layer, a valid use case could be this: lets say you are going to deploy your app on GAE. for the persistence, there are several options: - JDO/JPA - DataStore LowLevel APIs - Objectify, Twig Persist many of these technologies are new and subject to (rapid) change, it is a good idea to use interfaces to declare our DataAccess contract without exposing infrastructure related detail that is specific to each of those technologies. if one has 20 domain objects(entities), and for each entity, certain requests/methods : findX, findXInRange, findByX, it can get out of hand quickly. it would be very difficult to swap one persistence technology for another, sometime down the road. the idea is, - loose coupling - easily swapping infrastructure specific code, without affecting other part of system (easy refactoring, testing,) - clearly defined contracts in the form of interfaces, when you look at an interface you can see what is expected of this DAO, rather than going through hundreds of lines of codes, some of which scattered with try/catch/finally blocks (i am exaggerating a bit, IDEs can provide a quick overview) having said that, if one is working on a project that uses a legacy database, a database that's been in that environment for years, where DBAs have developed custom scripts, and its been used in day to day operation of that business/organization for many years, and there are policies within that business/organization to continue using that database in the future, I agree, using abstractions might be an overkill. As with most things, I believe it all depends on the requirements/ constraints. -- 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-tool...@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: Is selectionModel.setSelected asynchronous?
AbstractSelectionModel.setSelected() schedules selection change event to be fired at the end of the current event loop, so a new event will be fired after onSelectionChange() is executed. On Dec 23, 2:24 pm, Jaroslav Z?ruba jaroslav.zar...@gmail.com wrote: Hello I'm trying to clear selection on a list that has selectionChangeHandler attached to it. This fires a new event that triggers the handler again. I'd like to ignore the event that has been triggered as result of me clearing the selection. The problem is that there seems to be stuff happening asynchronously. new SelectionChangeEvent.Handler() { boolean muted = false; @SuppressWarnings(unchecked) @Override public void onSelectionChange(SelectionChangeEvent event) { if(muted) return; NoSelectionModelUser selectionModel = (NoSelectionModelUser) event.getSource(); User user = selectionModel.getLastSelectedObject(); // ... muted = true; // I'd expect the following line to launch onSelectionChange again, with muted=true selectionModel.setSelected(user, false); // instead following one gets evaluated muted = false; // and the handler gets triggered after that, obviously with muted=false again :( } } I could check whether the user is null and return out of the handler but I don't like that kind of workaround because null selection != invalid selection; and (more importantly) this ?async? evaluation does not seem right... What am I missing please? J. Záruba -- 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-tool...@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: Is selectionModel.setSelected asynchronous?
:( thank you -- 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-tool...@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: GWT 2.1.1 RequestFactory Strange Exception
SL vs DAL, one example of how they are different is that: let's say we have a DAO for accessing a Customer entity a DAO for accessing Account entity a DAO for accessing History/Trend entity // maybe not a good example, but just three separate entities a Service(object) living in a ServiceLayer, needs to access these three entities, analyze them and based on a current condition, apply a policy, and then notify the interested parties. the Logic for sending Notification is in another Object. the Logic for Accessing/Finding those entities are in another object. our Service(object) responsibility is to perform some operation, with the help of those other objects. (through collaboration). in this case, our Service is not just a basic CRUD. to complicate things further, (in a real world scenario), not all of the data might come from same DataStore, one using a local DataStore, one a WebService to retrieve realtime data, so when going beyond basic CRUD, the need for a Separate(isolated) ServiceLayer and DataAccessLayer, becomes more obvious. -- 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-tool...@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: gzippen all gwt output files?
Did some more reading and trial and error and have it now working as followed: 1) In Apache config file: a): Directory YOUR GWT DIR Options +MultiViews AddEncoding x-gzip .gz .tgz /Directory b): FilesMatch \..js.gz$ ForceType text/javascript /FilesMatch 2) Remove all original not-gzipped files such that content negotiation occurs. If you remove b) (which I would like) it doesn't work as the Content- Type that the browser receives of a js.gz will be application/x-gzip which is wrong as it must be text/javascript, otherwise it doesnt work. Config snippet b) will force this. I would suppose that b) isn't necessary and that Apache would discover and set this them self... but it didn't... So the question now: is this the way to do it?? My complain: I have to add b) snippets for every content type that is gzipped: css, js, xml, html, etc.. That seem awkward... Example of request and response headers: - Response Headersview source DateThu, 23 Dec 2010 23:20:38 GMT Server Apache/2.2.6 (Win32) Content-Locationlogin.nocache.js.gz Varynegotiate TCN choice Last-Modified Thu, 23 Dec 2010 20:35:17 GMT Accept-Ranges bytes Content-Length 2339 Cache-Control public, max-age=0, must-revalidate Expires Thu, 23 Dec 2010 23:20:38 GMT Content-Typetext/javascript Content-Encodinggzip Request Headersview source Hostlocalhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: 1.9.1.16) Gecko/20101130 Firefox/3.5.16 Accept */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/bv-web/ If-Modified-Since Thu, 23 Dec 2010 20:35:17 GMT Cache-Control max-age=0 -- 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-tool...@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: ValueProxy example
Thanks for your suggestion. It Worked!!! On Dec 23, 12:16 pm, Thomas Broyer t.bro...@gmail.com wrote: Even though they're not really relationships, they probably (I haven't yet checked) obey the same rules:http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.h... When querying the server, RequestFactory does not automatically populate relations in the object graph. To do this, use the with() method on a request and specify the related property name as a String: Request findReq = requestFactory.personRequest().find(personId).with(address); -- 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-tool...@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: gzippen all gwt output files?
OK :( Couldn't let it rest... Found out that the above b) snippet isn't necessary, but was because I had somewhere in my apache config the following line that spoiled it: AddType application/x-gzip .gz .tgz So every file returned with .gz as extension got automatically this content type back which was incorrect Bottom line: 1) Remove all not gzipped files otherwise apache will not perform any content negotiation and simple returns the unzipped file. 2) Add the following lines to your apache config (in a Directory/Files/ Location directive if you whish): Options +MultiViews AddEncoding x-gzip .gz And that's it... Because all the modern browsers support gzip, it's safe to remove the original unzipped files. Now I still have to find out how to gzip my remaining static resources... Thomas: how do you that ? and where you put your static resources? -- 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-tool...@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: 2.1 MVP and handlers
Thanks Thomas and Y2i - shortly after I posted I read in the API that the EventBus passed in onStart is a ResettableEventBus (that wraps the EventBus given in the ActivityManager?) My application is a tabbed application (its quite good for our workflow) with a secure login. There is a full screen login widget, and that is replaced by a SmartGWT TabSet once the login succeeds. Tabs are generated once the user logs in based on their permissions. Each tab also has its own Activity+View. The TabSet is only simulated, there is only one content panel which is used by the ActivityManager to change the View. The TabSet has listeners on PlaceChangeEvent and change the selected tab accordingly. The way I've approached this as a first pass test is that there is a PlaceController+ActivityMapper+ActivityManager+EventBus for going between the login page and the TabSet. There is also a second set of PlaceController+ActivityMapper+ActivityManager+EventBus thats used by the TabSet itself to go between the different tabs. Amazingly this works really well - logging in, switching tabs, and logging out all works wonderfully. However, history falls apart. I would have hoped the back/forward buttons take me through the tabs (I can see the tokens appearing correctly in the address bar). atm I also have two PlaceHistoryHandlers - I'm assuming this is where my problem is. Unfortunately I think I simply don't have a good enough understanding of the interaction of these new classes to make an informed choice on what I should be doing. 1) Judging from the PlaceHistoryHandler source each instance of PlaceHistoryHandler should receive the change event - do I need a more sophisticated Historian to handle whether the change event (eg, just a tab changing, or logging out) should be handled by that PlaceHistoryHandler? 2) Having two PlaceControllers seems illogical to me, but this was a side effect of having two PlaceHistoryHandlers. I think I'm quite confused here as to how it should come together? Sunny On Dec 23, 8:51 pm, Thomas Broyer t.bro...@gmail.com wrote: On Thursday, December 23, 2010 3:38:12 AM UTC+1, sunny...@gmail.com wrote: Hi everyone, Before 2.1 I created an application that use the old MVP architecture of having models, views and presenters. This worked quite well. I'm migrating this application to use the 2.1 MVP framework now. I've made some progress but am still getting my head around it. This has hit me so far: in my old code, the presenter was responsible for setting the listeners/handlers on the view/eventbus respectively. Where appropriate handlers would be removed when the view changed so that events are not handled more than once. (eg, I destroy my login window once login succeeds, and I also remove the eventbus LoginSucceededEvent handler, so after logging out there aren't two of them listening on the eventbus) Here is the start method of the apps' login activity: @Override public void start(AcceptsOneWidget panel, EventBus eventBus) { LoginView view = clientFactory.getLoginView(); // just one instance bindView(view); // eg, view.getButton().addClickHandler(... bindEvents(view, eventBus); // eg, eventBus.addHandler( panel.setWidget(view.asWidget()); } The LoginView is reused from the ClientFactory as the documentation suggests. This raises two questions: 1) I would like to keep the GUI bindings outside the UI code (just as I did in the old code where it was in the presenter). But since the documentation suggests using a single instance of a the views, here I would be adding more and more listeners each time the activity is initialised (as they are in the ActivityMapper). The HelloMVP example has the binding code in the view and allows the view to communicate with the activity. Can this be avoided? It would help in keeping the UI code strictly to UI and presentation. Short of implementing a method on all views that clear its listeners I cannot think of a better way (I would still think this to be cumbersome - its not something you'd normally do) First, you have to understand the why of this suggestion: everything DOM-related is slow. This means that creating a view is slow (compared to creating any other POJO, such as your presenters/activities). Having initially worked with the HasXxxHandlers approach (MVP tutorial - part 1) and later switched to the delegates approach (quite some time before the MVP tutorial - part 2 and places activities tutorials were written), I assure you that writing unit tests is wy easier with the latter ! (I also find the presenter code more readable, and it allows using @UiHandler methods in your view if you use UiBinder). If you want to make the switch, I assure you you won't regret it. That being said, you're not forced to do the switch. If you want to keep your addXxxHandler calls in your presenter, then you'll have to remove them when the activity is over. This means
Re: requestfactory: server side query using JPQL
i tried, unfortunately it does not work, but, if i use the following query: select o from Person as o where o.address IS not NULL it work fine and just get all person that their address is not null. what's wrong with the original query? -- 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-tool...@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.
Problem while calling servlet using Jetty
Hi Guys, I installed jetty on my ubuntu and uploaded my webapplication in webapps folder of jetty but when i am trying to call my servlet using $ajax $(#signIn).click(function(){ $.ajax({ type: POST, url: http://localhost:8090/myapp/myappmodule/getToken;, contentType: text/html, success: function(msg) { window.open(msg); } }); }); but it gives me following message : HTTP ERROR 404 Problem accessing /myapp/myappmodule/getToken. Reason: NOT_FOUND -- 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-tool...@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.
[gwt-contrib] Re: Use instanceof to find the right top level GwtSpecificValidator. (issue1239802)
LGTM On 2010/12/23 04:39:40, Nick Chalko wrote: http://gwt-code-reviews.appspot.com/1239802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Mark test as Failing or NotSupported (issue1245801)
http://gwt-code-reviews.appspot.com/1245801/diff/1/2 File samples/validationtck/build.xml (right): http://gwt-code-reviews.appspot.com/1245801/diff/1/2#newcode140 samples/validationtck/build.xml:140: executable=${basedir}/countMarkedTests.sh I think this breaks support for non-unix users. http://gwt-code-reviews.appspot.com/1245801/diff/1/3 File samples/validationtck/countMarkedTests.sh (right): http://gwt-code-reviews.appspot.com/1245801/diff/1/3#newcode1 samples/validationtck/countMarkedTests.sh:1: #!/bin/bash Use /bin/sh http://gwt-code-reviews.appspot.com/1245801/diff/1/20 File samples/validationtck/test/com/google/gwt/sample/validationtck/util/Failing.java (right): http://gwt-code-reviews.appspot.com/1245801/diff/1/20#newcode35 samples/validationtck/test/com/google/gwt/sample/validationtck/util/Failing.java:35: * . Hard to understand. Trailing dot. http://gwt-code-reviews.appspot.com/1245801/diff/1/21 File samples/validationtck/test/com/google/gwt/sample/validationtck/util/NonTckTest.java (right): http://gwt-code-reviews.appspot.com/1245801/diff/1/21#newcode35 samples/validationtck/test/com/google/gwt/sample/validationtck/util/NonTckTest.java:35: * {...@link NonTckTest}. Rephrase http://gwt-code-reviews.appspot.com/1245801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Generator Result Caching for RPC, with some refinements to the underlying framework (issue1243801)
LGTM http://gwt-code-reviews.appspot.com/1243801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add support for arbitrary units in SplitLayoutPanel (issue1244801)
http://gwt-code-reviews.appspot.com/1244801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add support for arbitrary units in SplitLayoutPanel (issue1244801)
This change LG to me, but please run it by one of the GWT libraries team members first. http://gwt-code-reviews.appspot.com/1244801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add @Select, multiple @PluralCount/@Select to Messages (issue1246801)
LGTM http://gwt-code-reviews.appspot.com/1246801/diff/1/2 File user/src/com/google/gwt/i18n/client/Messages.java (right): http://gwt-code-reviews.appspot.com/1246801/diff/1/2#newcode204 user/src/com/google/gwt/i18n/client/Messages.java:204: * /pre/code Is it safe to explicitly rely on annotation order in Java? http://gwt-code-reviews.appspot.com/1246801/diff/1/6 File user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java (right): http://gwt-code-reviews.appspot.com/1246801/diff/1/6#newcode1301 user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java:1301: writer.println(switch (arg + listArgNum + _size) {); Missing writer.indent(); http://gwt-code-reviews.appspot.com/1246801/diff/1/6#newcode1352 user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java:1352: writer.outdent(); Missing writer.outdent(); http://gwt-code-reviews.appspot.com/1246801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add @Select, multiple @PluralCount/@Select to Messages (issue1246801)
Thanks for the review. http://gwt-code-reviews.appspot.com/1246801/diff/1/2 File user/src/com/google/gwt/i18n/client/Messages.java (right): http://gwt-code-reviews.appspot.com/1246801/diff/1/2#newcode204 user/src/com/google/gwt/i18n/client/Messages.java:204: * /pre/code On 2010/12/23 17:51:40, pdr wrote: Is it safe to explicitly rely on annotation order in Java? It isn't the order of the annotations on an item but in this case it is the order of the parameters which are annotated with @PluralCount or @Select. http://gwt-code-reviews.appspot.com/1246801/diff/1/6 File user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java (right): http://gwt-code-reviews.appspot.com/1246801/diff/1/6#newcode1301 user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java:1301: writer.println(switch (arg + listArgNum + _size) {); On 2010/12/23 17:51:40, pdr wrote: Missing writer.indent(); Done. http://gwt-code-reviews.appspot.com/1246801/diff/1/6#newcode1352 user/src/com/google/gwt/i18n/rebind/MessagesMethodCreator.java:1352: writer.outdent(); On 2010/12/23 17:51:40, pdr wrote: Missing writer.outdent(); Done. http://gwt-code-reviews.appspot.com/1246801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9479 committed - Fix an NPE in SimpleRequestProcessor when a client request has no invo...
Revision: 9479 Author: gwt.mirror...@gmail.com Date: Thu Dec 23 11:25:33 2010 Log: Fix an NPE in SimpleRequestProcessor when a client request has no invocations. Issue 5793. Patch by: bobv Review by: rchandia Found by: cory.prowse Review at http://gwt-code-reviews.appspot.com/1242801 http://code.google.com/p/google-web-toolkit/source/detail?r=9479 Modified: /trunk/user/src/com/google/gwt/requestfactory/server/SimpleRequestProcessor.java /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java === --- /trunk/user/src/com/google/gwt/requestfactory/server/SimpleRequestProcessor.java Tue Dec 14 07:17:57 2010 +++ /trunk/user/src/com/google/gwt/requestfactory/server/SimpleRequestProcessor.java Thu Dec 23 11:25:33 2010 @@ -214,8 +214,7 @@ // Invoke methods ListSplittable invocationResults = new ArrayListSplittable(); ListBoolean invocationSuccess = new ArrayListBoolean(); -ListInvocationMessage invlist = req.getInvocations(); -processInvocationMessages(source, invlist, invocationResults, +processInvocationMessages(source, req, invocationResults, invocationSuccess, returnState); // Store return objects @@ -225,8 +224,11 @@ toProcess.putAll(returnState.beans); createReturnOperations(operations, returnState, toProcess); -resp.setInvocationResults(invocationResults); -resp.setStatusCodes(invocationSuccess); +assert invocationResults.size() == invocationSuccess.size(); +if (!invocationResults.isEmpty()) { + resp.setInvocationResults(invocationResults); + resp.setStatusCodes(invocationSuccess); +} if (!operations.isEmpty()) { resp.setOperations(operations); } @@ -409,9 +411,14 @@ } private void processInvocationMessages(RequestState state, - ListInvocationMessage invlist, ListSplittable results, - ListBoolean success, RequestState returnState) { -for (InvocationMessage invocation : invlist) { + RequestMessage req, ListSplittable results, ListBoolean success, + RequestState returnState) { +ListInvocationMessage invocations = req.getInvocations(); +if (invocations == null) { + // No method invocations which can happen via RequestContext.fire() + return; +} +for (InvocationMessage invocation : invocations) { try { // Find the Method String[] operation = invocation.getOperation().split(::); === --- /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java Wed Dec 15 12:13:06 2010 +++ /trunk/user/test/com/google/gwt/requestfactory/client/RequestFactoryTest.java Thu Dec 23 11:25:33 2010 @@ -884,6 +884,19 @@ } catch (IllegalArgumentException expected) { } } + + /** + * Tests a no-op request. + */ + public void testNoOpRequest() { +delayTestFinish(DELAY_TEST_FINISH); +simpleFooRequest().fire(new ReceiverVoid() { + @Override + public void onSuccess(Void response) { +finishTestAndReset(); + } +}); + } /** * Ensures that a service method can respond with a null value. @@ -1008,7 +1021,7 @@ */ public void testNullValueInIntegerListRequest() { delayTestFinish(DELAY_TEST_FINISH); -ListInteger list = Arrays.asList(new Integer[]{1, 2, null}); +ListInteger list = Arrays.asList(new Integer[] {1, 2, null}); final RequestVoid fooReq = req.simpleFooRequest().receiveNullValueInIntegerList( list); fooReq.fire(new ReceiverVoid() { @@ -1024,7 +1037,7 @@ */ public void testNullValueInStringListRequest() { delayTestFinish(DELAY_TEST_FINISH); -ListString list = Arrays.asList(new String[]{nonnull, null, null}); +ListString list = Arrays.asList(new String[] {nonnull, null, null}); final RequestVoid fooReq = req.simpleFooRequest().receiveNullValueInStringList( list); fooReq.fire(new ReceiverVoid() { @@ -1034,6 +1047,22 @@ } }); } + + /** + * Tests a message consisting only of operations, with no invocations. + */ + public void testOperationOnlyMessage() { +delayTestFinish(DELAY_TEST_FINISH); +RequestContext ctx = simpleFooRequest(); +SimpleFooProxy proxy = ctx.create(SimpleFooProxy.class); +proxy.setUserName(GWT); +ctx.fire(new ReceiverVoid() { + @Override + public void onSuccess(Void response) { +finishTestAndReset(); + } +}); + } public void testPersistAllValueTypes() { delayTestFinish(DELAY_TEST_FINISH); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9480 committed - Updated missingplugin to support IE 32 and 64 bits dev mode plugin.
Revision: 9480 Author: gwt.mirror...@gmail.com Date: Thu Dec 23 13:01:51 2010 Log: Updated missingplugin to support IE 32 and 64 bits dev mode plugin. http://code.google.com/p/google-web-toolkit/source/detail?r=9480 Modified: /trunk/plugins/MissingPlugin/build.xml /trunk/plugins/MissingPlugin/war/MissingPlugin.html === --- /trunk/plugins/MissingPlugin/build.xml Fri Nov 13 16:38:10 2009 +++ /trunk/plugins/MissingPlugin/build.xml Thu Dec 23 13:01:51 2010 @@ -23,8 +23,6 @@ pathelement location=war/WEB-INF/classes/ pathelement location=${gwt.user.jar} / pathelement location=${gwt.dev.jar} / -!-- Add any additional non-server libs (such as JUnit) -- -fileset dir=war/WEB-INF/lib includes=**/*.jar/ /path target name=javac description=Compile java source === --- /trunk/plugins/MissingPlugin/war/MissingPlugin.html Mon Dec 6 04:11:44 2010 +++ /trunk/plugins/MissingPlugin/war/MissingPlugin.html Thu Dec 23 13:01:51 2010 @@ -88,11 +88,19 @@ ie : { caption : Download the GWT Developer PluginbrFor Internet Explorer, -url : https://dl-ssl.google.com/tag/s/appguid%3D%7B9a5e649a-ec63-4c7d-99bf-75adb345e7e5%7D%26lang%3Den%26appname%3DGWT%2520Developer%2520Plugin%2520for%2520IE%26needsadmin%3Dfalse/gwt/plugins/ie/GwtDevPluginSetup.exe;, +url : https://dl-ssl.google.com/tag/s/appguid%3D%7B9a5e649a-ec63-4c7d-99bf-75adb345e7e5%7D%26lang%3Den%26appname%3DGWT%2520Developer%2520Plugin%2520for%2520IE%2520%2528x86%2529%26needsadmin%3Dfalse/gwt/plugins/ie/GwtDevPluginSetup.exe;, platforms : Win x86, supported : true }, + ie-x64 : + { +caption : Download the GWT Developer PluginbrFor Internet Explorer (64-bit), +url : https://dl-ssl.google.com/tag/s/appguid%3D%7B53dae7d2-8c28-440f-920b-b2d665ce73b2%7D%26lang%3Den%26appname%3DGWT%2520Developer%2520Plugin%2520for%2520IE%2520%2528x64%2529%26needsadmin%3Dfalse/gwt/plugins/ie/GwtDevPluginSetup.exe;, +platforms : Win x64, +supported : true + }, + safari-mac : { caption : Download the GWT Developer PluginbrFor Safari, @@ -104,7 +112,6 @@ }; var ua = navigator.userAgent.toLowerCase(); - var id = 'unknown'; if (ua.indexOf(webkit) != -1) { if ( (ua.indexOf(iphone) != -1) || (ua.indexOf(ipod) != -1) ) { @@ -119,7 +126,7 @@ id = 'safari-win'; } } else if (ua.indexOf(msie) != -1) { -id = 'ie'; +id = (ua.indexOf(win64) == -1) ? 'ie' : 'ie-x64'; } else if (ua.indexOf(opera) != -1) { id = 'opera'; } else if (ua.indexOf(gecko) != -1) { -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
Reviewers: zundel, Description: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. Please review this at http://gwt-code-reviews.appspot.com/1247801/show Affected files: M user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java Index: user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java === --- user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java (revision 9475) +++ user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java (working copy) @@ -334,7 +334,7 @@ * Returns the day which starts the weekend, as an index into the return value * of {...@link #weekdaysFull()}. */ - int weekendEnd(); + int weekendStart(); /** * Returns the day which ends the weekend, as an index into the return value @@ -343,5 +343,5 @@ * and {...@link #weekendStart()} of 0 means Saturday and Sunday are the * weekend. */ - int weekendStart(); + int weekendEnd(); } -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
http://gwt-code-reviews.appspot.com/1247801/diff/1/2 File user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java (right): http://gwt-code-reviews.appspot.com/1247801/diff/1/2#newcode337 user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java:337: int weekendStart(); This will generate checkstyle errors for the methods being out of order. Instead, change the javadoc. http://gwt-code-reviews.appspot.com/1247801/diff/1/2#newcode342 user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java:342: * than {...@link #weekendEnd()} - for example, {...@link #weekendEnd()} of 6 Please fix the formatting of the javadoc while you are here, and change the first weekendEnd on this line to weekendStart. Also, the 6/0 should be swapped. http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Generator Result Caching implementation for ClientBundle (issue1236801)
http://gwt-code-reviews.appspot.com/1236801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
http://gwt-code-reviews.appspot.com/1247801/diff/5001/6001 File user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java (right): http://gwt-code-reviews.appspot.com/1247801/diff/5001/6001#newcode334 user/src/com/google/gwt/i18n/client/DateTimeFormatInfo.java:334: * Returns the day which ends the weekend, as an index into the return value On 2010/12/23 21:30:52, jat wrote: I think the Javadoc for weekendEnd should be: Returns the day which ends the weekend, as an index into the return value of {...@link #weekdaysFull()}. pNote that this value may be numerically less than {...@link#weekendend()} - for example, {...@link #weekendStart()} of 6 and {...@link #weekendEnd()} of 0 means Saturday and Sunday are the weekend. Looks like that note belongs to weekendStart, doesn't it? http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
Looks like that note belongs to weekendStart, doesn't it? You could have it on either or both, but it seems more natural to say the endpoint could be before the start point on the end point. http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
On 2010/12/23 21:43:04, jat wrote: Looks like that note belongs to weekendStart, doesn't it? You could have it on either or both, but it seems more natural to say the endpoint could be before the start point on the end point. Makes sense, just need to update that first link which threw me off then. http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix swapped javadoc for weekendStart() weekendEnd() in DateTimeFormatInfo. (issue1247801)
LGTM http://gwt-code-reviews.appspot.com/1247801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] [google-web-toolkit] r9481 committed - Generator Result Caching for RPC, with some refinements to the underly...
Revision: 9481 Author: jbrosenb...@google.com Date: Thu Dec 23 06:00:26 2010 Log: Generator Result Caching for RPC, with some refinements to the underlying framework Review at http://gwt-code-reviews.appspot.com/1243801 http://code.google.com/p/google-web-toolkit/source/detail?r=9481 Added: /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExtWrapper.java /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorExtWrapper.java Modified: /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorExt.java /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java /trunk/dev/core/src/com/google/gwt/dev/shell/StandardRebindOracle.java /trunk/user/src/com/google/gwt/rpc/rebind/RpcProxyCreator.java /trunk/user/src/com/google/gwt/user/rebind/rpc/ProxyCreator.java /trunk/user/src/com/google/gwt/user/rebind/rpc/ServiceInterfaceProxyGenerator.java /trunk/user/src/com/google/gwt/user/rebind/rpc/TypeSerializerCreator.java === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorContextExtWrapper.java Thu Dec 23 06:00:26 2010 @@ -0,0 +1,104 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.gwt.core.ext; + +import com.google.gwt.core.ext.linker.Artifact; +import com.google.gwt.core.ext.linker.GeneratedResource; +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.TypeOracle; +import com.google.gwt.dev.javac.rebind.CachedRebindResult; +import com.google.gwt.dev.resource.ResourceOracle; + +import java.io.OutputStream; +import java.io.PrintWriter; + +/** + * EXPERIMENTAL and subject to change. Do not use this in production code. + * p + * A wrapper to access a base {...@link GeneratorContext} instance as a + * {...@link GeneratorContextExt} instance. Methods from the + * {...@link GeneratorContext} interface are passed through to the baseContext, + * while methods from the {...@link GeneratorContextExt} interface are given + * default stub implementations. + */ +public class GeneratorContextExtWrapper implements GeneratorContextExt { + + /** + * Get a new instance wrapped from a base {...@link GeneratorContext} + * implementation. + */ + public static GeneratorContextExt newInstance(GeneratorContext baseContext) { +return new GeneratorContextExtWrapper(baseContext); + } + + private final GeneratorContext baseContext; + + public GeneratorContextExtWrapper(GeneratorContext baseContext) { +this.baseContext = baseContext; + } + + public void commit(TreeLogger logger, PrintWriter pw) { +baseContext.commit(logger, pw); + } + + public void commitArtifact(TreeLogger logger, Artifact? artifact) + throws UnableToCompleteException { +baseContext.commitArtifact(logger, artifact); + } + + public GeneratedResource commitResource(TreeLogger logger, OutputStream os) + throws UnableToCompleteException { +return baseContext.commitResource(logger, os); + } + + public CachedRebindResult getCachedGeneratorResult() { +return null; + } + + public PropertyOracle getPropertyOracle() { +return baseContext.getPropertyOracle(); + } + + public ResourceOracle getResourcesOracle() { +return baseContext.getResourcesOracle(); + } + + public long getSourceLastModifiedTime(JClassType sourceType) { +return 0L; + } + + public TypeOracle getTypeOracle() { +return baseContext.getTypeOracle(); + } + + public boolean isGeneratorResultCachingEnabled() { +return false; + } + + public boolean reuseTypeFromCacheIfAvailable(String typeName) { +return false; + } + + public PrintWriter tryCreate( + TreeLogger logger, String packageName, String simpleName) { +return baseContext.tryCreate(logger, packageName, simpleName); + } + + public OutputStream tryCreateResource(TreeLogger logger, String partialPath) + throws UnableToCompleteException { +return baseContext.tryCreateResource(logger, partialPath); + } +} === --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/core/ext/GeneratorExtWrapper.java Thu Dec 23 06:00:26 2010 @@ -0,0 +1,70 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the License); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + *
[gwt-contrib] [google-web-toolkit] r9482 committed - Ensure that enum types reachable through AutoBean method parameterizat...
Revision: 9482 Author: b...@google.com Date: Thu Dec 23 07:05:27 2010 Log: Ensure that enum types reachable through AutoBean method parameterizations are included in the EnumMap. Patch by: bobv Review by: jbrosenberg Review at http://gwt-code-reviews.appspot.com/1240801 http://code.google.com/p/google-web-toolkit/source/detail?r=9482 Modified: /trunk/user/src/com/google/gwt/autobean/rebind/model/AutoBeanFactoryModel.java /trunk/user/src/com/google/gwt/autobean/rebind/model/AutoBeanMethod.java /trunk/user/test/com/google/gwt/autobean/shared/AutoBeanCodexTest.java === --- /trunk/user/src/com/google/gwt/autobean/rebind/model/AutoBeanFactoryModel.java Wed Nov 10 11:04:47 2010 +++ /trunk/user/src/com/google/gwt/autobean/rebind/model/AutoBeanFactoryModel.java Thu Dec 23 07:05:27 2010 @@ -249,7 +249,7 @@ AutoBeanMethod toAdd = builder.build(); // Collect referenced enums - if (toAdd.isEnum()) { + if (toAdd.hasEnumMap()) { allEnumConstants.putAll(toAdd.getEnumMap()); } === --- /trunk/user/src/com/google/gwt/autobean/rebind/model/AutoBeanMethod.java Wed Nov 10 11:04:47 2010 +++ /trunk/user/src/com/google/gwt/autobean/rebind/model/AutoBeanMethod.java Thu Dec 23 07:05:27 2010 @@ -21,6 +21,7 @@ import com.google.gwt.core.ext.typeinfo.JEnumType; import com.google.gwt.core.ext.typeinfo.JMethod; import com.google.gwt.core.ext.typeinfo.JPrimitiveType; +import com.google.gwt.core.ext.typeinfo.JType; import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.editor.rebind.model.ModelUtils; @@ -158,40 +159,29 @@ toReturn.method = method; TypeOracle oracle = method.getEnclosingType().getOracle(); - toReturn.isValueType = ModelUtils.isValueType(oracle, - method.getReturnType()); + JType returnType = method.getReturnType(); + toReturn.isValueType = ModelUtils.isValueType(oracle, returnType); if (!toReturn.isValueType) { // See if it's a collection or a map -JClassType returnClass = method.getReturnType().isClassOrInterface(); +JClassType returnClass = returnType.isClassOrInterface(); JClassType collectionInterface = oracle.findType(Collection.class.getCanonicalName()); JClassType mapInterface = oracle.findType(Map.class.getCanonicalName()); if (collectionInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( collectionInterface, returnClass); toReturn.elementType = parameterizations[0]; + maybeProcessEnumType(toReturn.elementType); } else if (mapInterface.isAssignableFrom(returnClass)) { JClassType[] parameterizations = ModelUtils.findParameterizationOf( mapInterface, returnClass); toReturn.keyType = parameterizations[0]; toReturn.valueType = parameterizations[1]; -} - } - - JEnumType enumType = method.getReturnType().isEnum(); - if (enumType != null) { -MapJEnumConstant, String map = new LinkedHashMapJEnumConstant, String(); -for (JEnumConstant e : enumType.getEnumConstants()) { - String name; - PropertyName annotation = e.getAnnotation(PropertyName.class); - if (annotation == null) { -name = e.getName(); - } else { -name = annotation.value(); - } - map.put(e, name); -} -toReturn.enumMap = map; + maybeProcessEnumType(toReturn.keyType); + maybeProcessEnumType(toReturn.valueType); +} + } else { +maybeProcessEnumType(returnType); } } @@ -202,6 +192,39 @@ public void setStaticImp(JMethod staticImpl) { toReturn.staticImpl = staticImpl; } + +/** + * Call {...@link #processEnumType(JEnumType)} if {...@code type} is a + * {...@link JEnumType}. + */ +private void maybeProcessEnumType(JType type) { + assert type != null : type == null; + JEnumType enumType = type.isEnum(); + if (enumType != null) { +processEnumType(enumType); + } +} + +/** + * Adds a JEnumType to the AutoBeanMethod's enumMap so that the + * AutoBeanFactoryGenerator can embed extra metadata about the enum values. + */ +private void processEnumType(JEnumType enumType) { + MapJEnumConstant, String map = toReturn.enumMap; + if (map == null) { +map = toReturn.enumMap = new LinkedHashMapJEnumConstant, String(); + } + for (JEnumConstant e : enumType.getEnumConstants()) { +String name; +PropertyName annotation = e.getAnnotation(PropertyName.class); +if (annotation == null) { + name = e.getName(); +} else { + name = annotation.value(); +} +map.put(e, name); + } +} }