allthenutsandbolts
allthenutsandbolts

Reputation: 1523

Css not being found in deployed grails application

I'm using the extjs plugin and I have the following line in my gsp file

<link rel="stylesheet" href="${resource(dir:'ext/resources/css', file: 'xtheme-gray.css')}" />

when I run the app using grails run-app I can see that this CSS is being used. When I package it as a war and deploy it as an application, I'm seeing an 404 error saying "css is not found'

My version of grails is 2.1.1

Here is the generated HTML

<head>
  <title>Sentry Information Report Login</title>
  <link rel="stylesheet" href="/sentry-web-1.0-SNAPSHOT/static/ext/resources/css/ext-all.css" />
  <script type="text/javascript" src="/sentry-web-1.0-SNAPSHOT/static/ext/adapter/ext/ext-base.js"></script>
  <script type="text/javascript" src="/sentry-web-1.0-SNAPSHOT/static/ext/ext-all.js"></script>

    <meta name="layout" content="ext"/>
    <link rel="stylesheet" href="/sentry-web-1.0-SNAPSHOT/static/ext/resources/css/xtheme-gray.css" />


</head>

Upvotes: 0

Views: 1656

Answers (2)

allthenutsandbolts
allthenutsandbolts

Reputation: 1523

Here is how I got it to work

<link rel="stylesheet" href="${resource(dir:'static/ext/resources/css', file: 'xtheme-gray.css') }" />

I will test it on Tomcat also. I havee to download it

Upvotes: 0

user800014
user800014

Reputation:

I was able to reproduce your error here. What I did to solve:

Updated resources plugin in BuildConfig.groovy

runtime ":resources:1.2.RC2"

And in the resource method, defined to look into the plugin for the resource:

<link rel="stylesheet" href="${resource(dir:'ext/resources/css', file: 'xtheme-gray.css', plugin: 'extjs')}" />

Upvotes: 1

Related Questions