Possible Duplicate:
Problem calling grails service from gsp
I have a service called HeaderService that is in a package called application in a project called Portfolio. How can i import this service into a gsp? I have tried
<%@ page import="com.portfolio.application.HeaderService" %>
And many variations, but It doesnt work. Anyone have any suggestions? Thanks!
You can access your services through the applicationContext
object that's implicitly available in views. Example:
<%= applicationContext.headerService.doSomething() %>