class BookController { def list = { log.info "User agent: " + request.getHeader("User-Agent") render(view:actionName) } }
查看Grails为request对象添加的方法可参考Grails Servlet API。