How could I keep the socket open? Is there a way to do that from within the Resource class? Unfortunately javascript and HTML redirection work only with web browsers - such a practice would fail for curl clients...
On Mon, 2009-12-28 at 05:17 -0800, Ben R Vesco wrote: > "you will be redirected in x seconds" type pages are a javascript > thing unless you have kept a socket open. > > > On Sun, Dec 27, 2009 at 2:18 AM, Sopasakis Pantelis <[email protected]> > wrote: > > Hi all, > > I need to support redirection for a resource but first return the > > message "You will be redirected to another page in 2 seconds...", so I > > tried the following code... > > > > > > @Override > > protected Representation get(Variant variant) throws > > ResourceException { > > > > Thread thread = new Thread() { > > @Override > > public void run() { > > try { > > Thread.sleep(2000); > > getResponse().redirectTemporary("/other"); > > } catch (InterruptedException ex) { } > > } > > }; > > thread.start(); > > return new StringRepresentation("message goes here"); > > } > > > > > > I understand why this doesn't work (it's because nothing really happens > > after the return statement), but I'd like to know if there is some way > > to do this in Restlet. > > > > Thanks a lot in advance, > > > > Sopasakis Pantelis > > Dipl. Chemical Engineer, > > MSc. Applied Mathematics > > National Technical University of Athens > > Automatic Control Laboratory > > email: [email protected] > > tel(office): +30 210 7723236 > > > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433291 > > > > ------------------------------------------------------ > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433336 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433405

