Guten Tag ab,
you should keep the MODE_CLIENT_DISPATCHER mode.
Could you trace the sent requests/response with wireshark, for example?
Or let netcat listen on the 8080 (instead of your real server) port as
follow :
$>nc -l -p 8080
It will show you the request that arrives from the server listening on
port 8888.
Best regards,
Thierry Boileau
> Hallo Thierry,
>
> After I have changed the mode to Redirector.*MODE_SERVER_DISPATCHER*
> my createInboundRoot method looks like this:
> @Override
> public synchronized Restlet createInboundRoot() {
>
> Router router = new Router(getContext());
> router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
> router.attach("/RESTfulServices", new Redirector(getContext(),
> "http://localhost:8080/RESTfulServices{rr}",
> Redirector.MODE_SERVER_DISPATCHER));
> return router;
>
> }
> but I still receive no answer. My std output looks like this:
>
> 24.02.2010 10:51:00 org.restlet.engine.http.connector.HttpClientHelper start
> INFO: Starting the default HTTP client
> 24.02.2010 10:51:00 org.restlet.routing.Redirector handle
> INFO: Redirecting via server dispatcher to:
> http://localhost:8080/RESTfulServices/resources/customers/pkey/2176172632
> 24.02.2010 10:51:00 org.restlet.engine.log.LogFilter afterHandle
> INFO: 2010-02-24 10:51:00 127.0.0.1 - 127.0.0.1
> 8888 GET /RESTfulServices/resources/customers/pkey/2176172632 -
> 404 363 - 16 http://127.0.0.1:8888
> Restlet-Framework/2.0snapshot
> http://127.0.0.1:8888/testrestlet/hosted.html?testrestlet
> [WARN] 404 - GET
> /redirect/RESTfulServices/resources/customers/pkey/2176172632 (127.0.0.1) 363
> bytes
> Request headers
> Host: 127.0.0.1:8888
> User-Agent: Restlet-Framework/2.0snapshot
> Accept: */*
> Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
> Accept-Encoding: gzip,deflate
> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> Keep-Alive: 115
> Connection: keep-alive
> Referer: http://127.0.0.1:8888/testrestlet/hosted.html?testrestlet
> Response headers
> Content-Type: text/html; charset=ISO-8859-1
> Date: Wed, 24 Feb 2010 09:51:00 GMT
> Accept-Ranges: bytes
> Server: Restlet-Framework/2.0m7
> Content-Length: 363
>
>
> and my Firefox shows 404 with message "The server has not found
> anything matching the request URI".
>
> May be this will help you helping me ;)
>
> Thank you again,
>
> ab
> ------------------------------------------------------------------------
> View this message in context: Re: How to write an Universal redirector
> <http://n2.nabble.com/How-to-write-an-Universal-redirector-tp4620578p4624772.html>
> Sent from the Restlet Discuss mailing list archive
> <http://n2.nabble.com/Restlet-Discuss-f1400322.html> at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2451468