I have a Restlet API and a GWT web application in two seperate web applications. I have added the Restlet GWT jar to the GWT web application and written proxy classes for each of the API se开发者_开发百科rver resources.
How do I now link up the two? Do i need to add in a servlet into web.xml?
This is probably a beginner question and I might be being very silly but this is my first GWT app.
Yes, You need to setup your Restlet Servlet in the web.xml from your GWT project. Then, start you gwt project in debug mode (that will launch the jetty servlet) and you will have acces to http://127.0.0.1:8888/YourServlet/... You can eventually deploy the Restlet Servlet in another server.
Finally write your client services using RequestBuilder.
Have in mind that if you dispose your Restlet Services in another host different that the one where you serves you gwt pages (eg. your restlet is accesed in http://another_host:another_port/YourServlet) then you will have to deal with SOP (http://en.wikipedia.org/wiki/Same_origin_policy).
I recommend you to have different projects one for the server and another for the gwt. The first deployed in Server1 and the second served by Server2. And then deal with SOP using a http proxy which you need to install in Server2.
精彩评论