Note that there are some explanatory texts on larger screens.

plurals
  1. POStatic is not returning any css or js resources in Grails 1.4
    primarykey
    data
    text
    <p>I have just created my first Grails 1.4 application, and am having some problems with the new resourse management: the "static handler" is not returning any css or js files, but instead saying:</p> <pre><code>ERROR resource.ResourceMeta - Resource not found: /static/plugins/jquery-ui-1.8.15/jquery-ui/themes/ui-lightness/jquery-ui-1.8.15.custom.css ERROR resource.ResourceMeta - Resource not found: /static/plugins/jquery-1.6.1.1/js/jquery/jquery-1.6.1.min.js ERROR resource.ResourceMeta - Resource not found: /static/plugins/blueprint-1.0.2/css/blueprint/screen.css ERROR resource.ResourceMeta - Resource not found: /static/plugins/jquery-ui-1.8.15/jquery-ui/js/jquery-ui-1.8.15.custom.min.js ERROR resource.ResourceMeta - Resource not found: /static/css/main.css ERROR resource.ResourceMeta - Resource not found: /static/js/application.js </code></pre> <p>Images are working fine!</p> <p>As you can see on the below files, I have really scrapped everything off - so I am thinking that I might be missing some general setting somewhere?</p> <p>The layout file (main.gsp):</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;g:layoutTitle/&gt; &lt;r:layoutResources/&gt; &lt;/head&gt; &lt;body&gt; &lt;g:layoutBody/&gt; &lt;r:layoutResources/&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The page (index.gsp):</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta name="layout" content="main"/&gt; &lt;r:require modules="jquery-ui, blueprint"/&gt; &lt;r:require module="core"/&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="form"&gt; &lt;r:img uri="/images/grails_logo.png" width="100" height="50"/&gt; Hello World &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The output HTML:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="/gdw/static/plugins/jquery-1.6.1.1/js/jquery/jquery-1.6.1.min.js" type="text/javascript" &gt;&lt;/script&gt; &lt;link href="/gdw/static/plugins/jquery-ui-1.8.15/jquery-ui/themes/ui-lightness/jquery-ui-1.8.15.custom.css" type="text/css" rel="stylesheet" media="screen, projection" /&gt; &lt;script src="/gdw/static/plugins/jquery-ui-1.8.15/jquery-ui/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript" &gt;&lt;/script&gt; &lt;link href="/gdw/static/plugins/blueprint-1.0.2/css/blueprint/screen.css" type="text/css" rel="stylesheet" media="screen, projection" /&gt; &lt;!--[if lt IE 8]&gt;&lt;link href="/gdw/static/plugins/blueprint-1.0.2/css/blueprint/ie.css" type="text/css" rel="stylesheet" media="screen,projection" /&gt;&lt;![endif]--&gt; &lt;link href="/gdw/static/css/main.css" type="text/css" rel="stylesheet" media="screen" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="form"&gt; &lt;img src="/gdw/static/images/grails_logo.png" width="100" height="50" /&gt; Hello World &lt;/div&gt; &lt;script src="/gdw/static/js/application.js" type="text/javascript" &gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And my modules (StaticResources.groovy):</p> <pre><code>modules = { core { dependsOn 'jquery' defaultBundle 'ui' resource url:'/css/main.css', attrs:[media:'screen'] resource url:'/js/application.js' } } </code></pre> <p>What am I missing? I tried without requiring the jQuery and blueprint but that didn't change the fact that main.css and application.js still was not found - and the files ARE there!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload