Search code examples
grailsgsp

Grails, Want to create a backlink from detail to master in the gsp


The title tells almost all. If I entered a edit-form from the master-edit-form using the the detail-link in the master-form, I would like to have a link back to the masterform. Of course I could use the browsers back-button but it would be more conveniant to have a custom backlink.

I've tried the following twoo examples, found on this forum, but they didn't take me anywhere:

        <li><a href="#" onclick="javascript:window.location.replace('${prevLoc}');">Back</a></li>
        <li><a href="#" onclick="javascript:window.history.back();">Back</a></li>

Solution

  • I think you just want a generic method of going back a page?

    Try the following in your gsp

    <g:link url="${request.getHeader('referer')}">Back</g:link>