I'm very new to Google Web Toolkit (GWT) and Google Apps Engine. I want to use Objectify directly in the entry point so that I can utilize GWT in my apps. (I use java)
Is it possible to load Objectify entities directly to the entry points without using any call to server side? I've read several tutorials about this topic but all of them either make a RPC call or use other servlet instead.
OR
Is there anyway to use GWT classes (such as Label, Textbox etc) in a servlet outside the entry point?
I am okay if any of the questions above answered. This is a quite general question, so if you have any reference for them I will appreciate it as well. Let me know if I need to add anything, and thank you!
GWT apps run on the client not the server. Objectify however is server side.
GWT will have to use some way to communicate with the server. Technically it would be possible to write a library like Objectify that does that all automatically for you but that would not be a very good idea as it would require to much communication between the client and the server. The client should send high level commands/queries to the server and let the server do most of the work.
Related
I just need a little hint in what direction my research should go.
Because currently I have a spring standalone jar project (spring-context, spring-data-jpa and hibernate entitymanager. Everything set up without xml files).
Now I want to run this application on two computers inside a network. Both should be able to send objects over the network. But I want to accomplish this without a web server (so no tomcat or glassfish).
Is this even possible? and how is this called?
I have problems finding something close to this plan. Most of the time I find tutorials and threads for sending objects with tomcat. But I more or less only need a open port that listens to incomming objects.
EDIT
Later I also want to put a third player in the communication process: A website. So then two standalone jar programs and one website will pass objects around. That's why I hope spring mvc will work for a stanalone solution as well.
(I know that this question will get tagged down, but it's ok, as long as I get some designations I can use to research better, so thanks ...)
You have many specifications. ProtoBuf seems to be interesting https://github.com/google/protobuf/tree/master/java
Without having server it would be a pain for you as you will have to implement concurrency, security and this kind of stuff.
Does Spring Boot work for you? Server is embeded ;-)
What about use normal java sockets? There is plenty information if you google it. If you need help with this just let me know and I can send you some java application. Just type Java Sockets and lets learn!
Alvaro.
I'm attempting to write a browser based MMO using libGDX and it's HTML5/GWT port and I have no idea how to do the client/server interactions. I have already written the application for desktop as a sort of "learning" project for myself, and have now decided to rewrite it into the browser.
I have never done browser development before, so I'm not quite sure of how to go about doing the networking portion of the project. I fear that this is because I'm not quite sure as to how GWT actually works, especially when being used for what I'm doing. I attempted to use a library called KryoNet for the networking but apparently you cannot use normal networking methods for GWT. I received this error: http://pastebin.com/DVJPA44N
In short, I need help/direction with how to do a client/server communications type deal with GWT if it's even possible. If there is an easy google answer I apologize, I'm not sure how to word what I'm looking for.
Thank you!
EDIT: I looked at the WebSockets API, and that's not quite what I'm looking for. I want to host a server locally off the desktop and communicate to the client hosted in the browser. I apologize if I'm just misunderstanding the whole servlet setup in GWT.
Did you have look at something like PlayN ( Angry Birds is top example using it with GWT for Browser port of the application )
Also you need to checkout WebSocket API ( either direct use in GWT/JSNI or via third-party gwt jar )
I am planning on building a GWT app that will be deployed to GAE. In addition to the normal (GWT) web client, the server-side code will service requests from other clients besides just the web app. Specifically, it will host a RESTful API that can be hit from any HTTP-compliant client, and it will also service requests from native apps on iOS and Android.
If my understanding of GWT is correct, it's your job to code up both the client-side code (which includes the AJAX requests your app makes back to the server) as well as the server-side request handlers.
This got me thinking: why do I need to package the web client and the web server inside the same WAR? This forces me to (essentially) re-deploy the client-side code every time I want to make a change to the backend. Probably not a big deal, but if I don't have to, I'd prefer to honor "separation of concerns".
So I ask: is there a way to essentially deploy a Java-less WAR on GAE in such a way that it just serves pure HTML/JS/CSS back to any clients that will use it, and to then deploy the server-side in its own WAR, and some how link the two up? Thanks in advance!
The WAR is just for the server side. It includes the client-side classes needed for serializing objects passed between client and server: obviously, both sides need implementations of the same objects in order to handle those objects.
I don't think it will save you any effort or development time to separate the two concerns, but if you really want to, then you can rework your client/server interaction using something other than GWT-RPC. For example, JSON. See https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideHttpRequests for discussion of your options if you want to go down that road.
No, AFAIK, you can not do partial update in GAE, i.e. you can not upload a part of the project to GAE instance and then upload in a separate upload another part (and so separating HTNML/JS/CSS to java classes).
Hopefully this is what you are looking for.
Finally the main stub that you want to deploy might be EAR file which you can mention in main pom.xml
First sorry for my english. I am currently trying to develop a JAVA webservice for Android devices. More precisely, the webservice provider would be an ordinary computer and webservices clients would be Android devices.
After I have read some tutorials, I have done this one (webservice + client), which require only Eclipse. Everything works OK. So my question is the following: given that my webservice is working well and is accessible, why would I use soap engine and application server, as mentionned in this short introduction to webservice ? Said another way, what are the advantages, concretely?
I have tried to google, read and learn more, but I am stuck at this point.. If I have well-understood, SOAP engines, like Apache AXIS, allow to dynamically generate SOAP data and to receive requests from different clients. But does not my webservice already generate automatically SOAP requests/responses, since I can use my webservice with my dedicated client?
Regarding application server, I just can't figure out what it is. I found few documentation about that I could understand.
I know that instead of asking these kind of question, a better way would be to practice myself soap engine and application server, but I would prefer to know what I am doing and using rather than to go in a "random mode".
I hope I've been clear, thanks a lot for you answers.
MCFarah
You asked a couple of questions which are quite heavy, but i'll try to give a brief overview:
Web/Application Servers are basically a piece of program that implements a lot of stuff that help the developer, by allowing him to focus on the actual development and not on the stuff around. Stuff like: Threads, security, Database connection pooling etc.
You don't have to use SOAP webservice, actually I think you'd be better off using REST.
The tutorial you did is a "Hello World" tutorial. It is only good for getting started but once you start writing a larger application you would want to use a web server. Id recommend starting with Tomcat.
Just start using the technologies and post questions as you go.
To put it simple, I've written a JSE Swing app that needs to talk to a GWT server I've written earlier.
I absolutely love the way GWT does remoting between it's javascript and server sides and wish I could utilize this mechanism.
Has anyone managed to use GWT-RPC this way? Should I just go Restlet instead?
If you are doing Java-to-Java communication, RMI would be simpler and more expedient. Serializing data to/from some XML or URL-based format doesn't add a lot of value.
With EJB3, it is dead simple to deploy remote objects and to call them. You can then turn those EJBs into web services if you need to later, but for Java-to-Java, I can't think of a good reason to not use some sort of RMI-based communication.