问题描述:

I'm using play 2 with java and I want to do something like this:

return ok("message") ; and after the user see the message (after 2 sec ) he will be redireted to "/home"

网友答案:

Do it with HTML or JavaScript, there is nothing to do for Play framework with it.

<meta http-equiv="refresh" content="2; url=http://example.com/">

or

<script>
    setTimeout(function(){
         window.location.href = 'http://example.com/'
    },2000);
</script>
相关阅读:
Top