views:

281

answers:

2

Using Grails 1.1 beta2 and a JSP page. The JSP includes the CSS reference:

<link rel="stylesheet" type="text/css" href="styles.css">

When this line is included Grails pukes with the error:

[7000] errors.GrailsExceptionResolver java.lang.NumberFormatException: For input string: "styles" org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NumberFormatException: For input string: "styles"
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1061)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:893)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:892)
        at groovy.lang.Closure.call(Closure.java:279)
        at groovy.lang.Closure.call(Closure.java:274)
        at org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsControllerHelper.handleAction(Simp
leGrailsControllerHelper.java:340)
        ...

If I remove the stylesheet tag then the page loads error free (but no CSS). Any ideas why?

A: 

A few things to check:

Is that tag being loaded into the HTML HEAD?

Can the styles.css file be 'found'?

Play around with the format...some standards documents use this syntax:

(note no quotes around STYLESHEET)

bochgoch
A: 

Try it:

<link rel="stylesheet" type="text/css" media="screen" href="${resource(dir:'path/to/css', file:'styles.css')}" />
Vladimir