I have:

<td>
   <g:link controller="dashboard" action="view">Dashboard</g:link>
   <a href="fkd.co">Hello</a>
</td>

The result is:

Dashboard Hello

有帮助吗?

解决方案 2

I just found out that <g:link> was overwritten and it was made only to create the links if the logged in user has access to that link otherwise emit the body text. The code looks like:

def link = { attrs, body ->

        def url = "/${pageScope.controllerName}/${attrs.action}"

        if( !securityService.isLoggedIn() ||
            securityService?.hasAccessToUri("/${pageScope.controllerName}/${attrs.action}") ) {

            def originalTagBean = grailsApplication.mainContext.getBean('org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib')

            originalTagBean.link.call(attrs, body)
        } else {
            out << body()
        }

    }

其他提示

It's look like your gsp page has not been compiled at all. Check source in the web browser. You should run embedded server with run-app command and then access the page.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top