grails - I want to provide a link to return the previous page on a 404 -
i have errorcontroller handles various application errors such 404, 500, etc. in these actions, render appropriate error pages. able provide link on these error pages takes user page prior receiving error.
i've tried getting http_referer header null. request.forwarduri gives me current request causing error.
suggestions?
class errorcontroller { def notfound() { def backtopage = getpreviouspage // here render view: '404', mode: [backtopage: backtopage] } }
you can use history.back() method.
<script> function goback() { window.history.back() } </script> <input type="button" value="back" onclick="goback()">
Comments
Post a Comment