"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 <ch...@mail.ntua.gr> 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: ch...@mail.ntua.gr
> 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

Reply via email to