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

Reply via email to