groovyzk/grailszk

Static assets returning 404 not found, not loading in .zul rendered files

maiconandsilva opened this issue · 1 comments

Given that image sources are at src/resources/public they should be referenced with a preceding "/static" in their relative paths (e.g <image src="/static/images/logo.png" /> should work with an image stored at src/resources/public/images/logo.png.

This is an intermittent bug, meaning that sometimes all the images are loaded as they should (status code 200).

The below route definition was catching some image paths.

    "/$controller/$action?/$id?(.${format})?"{
        constraints {
            // apply constraints here
        }
    }

Adding static excludes = ["/static/*"] to the UrlMappings class solved the problem. Removing the catch all route or applying constraints to it may solve the problem.