当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Redirect in play Framework

问题描述:

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>
分享给朋友:
您可能感兴趣的文章:
随机阅读: