Hello,

if you want to use the redirector, have a look at the tutorial here 
http://www.restlet.org/documentation/2.0/tutorial#part10, and at the 
javadocs (for setting the reverse proxy) here 
http://www.restlet.org/documentation/2.0/jse/api/org/restlet/routing/Redirector.html.

I hope this will help you. Feel free to ask more questions, if needed.

Best regards,
Thierry Boileau


> Hi all,
>
> I would like to set up a new GWT eclipse project to use GWT 2.0 and Restlet 
> 2.0M6.
>
> I want to write a simple application in GWT providing a REST client (using 
> Restlet and Json) accessing to an already running REST service on the web. As 
> the Rest service is not on the same host as the gwt application, I have to 
> use the redirector (due to cross-site scripting prevention policy).
>
> Is there a simple example showing that case?
> I found a piece of code (see below) to deal with GWT and rest but nothing for 
> the redirector and the configuration to work with GWT 2.0.
>
> Regards,
> Christophe.
>
> -----
> ClientResource r = new ClientResource(                                        
> "http://localhost:8888/test";);
>
> r.setOnReceived(new Uniform() {
>    public void handle(Request request, Response response) {
>    JsonRepresentation rep = new JsonRepresentation(response.getEntity());
>
>    try {
>      JSONObject object = rep.getValue().isObject();
>      if (object != null) {
>        for (String key : object.keySet()) {
>          jsonRoot.addItem(key + ":"+ object.get(key));
>        }
>      }
>    } catch (IOException e) {
>      e.printStackTrace();
>    }
> }
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434915
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434963

Reply via email to