Grails 3 how to access favicon, icon and tile files from app root
I have an Grails app that runs on http://localhost:8092
Different browsers look for certain files in the root path (http://localhost:8092/), for instance: favicon.ico, browserconfig.xml (looks for ms tiles on Windows), site.webmanifest (looks for icons + app name on Android that is used when adding the web app to home screen), safari-pinned-tab.svg (for Safari), favicon-32x32.png/favicon-16x16.png (for alternative size favicons), etc.
What I can make work is favicon.ico, adding it to grails-app/assets/images and using the asset pipeline in the GSP:
But the rest doesn't work. Also site.webmanifest and browserconfig.xml files have paths to certain images to be used as Android icons or Windows tiles respectively. I can change those paths to be under /assets/... but those files should be available under the Grails app root.
Looked in the docs and tried to find examples online but couldn't find anything for Grails 3.
How can I configure Grails to allow those files to be accessed from the app's root path?
BTW I'm using Grails 3.2.9
grails
add a comment |
I have an Grails app that runs on http://localhost:8092
Different browsers look for certain files in the root path (http://localhost:8092/), for instance: favicon.ico, browserconfig.xml (looks for ms tiles on Windows), site.webmanifest (looks for icons + app name on Android that is used when adding the web app to home screen), safari-pinned-tab.svg (for Safari), favicon-32x32.png/favicon-16x16.png (for alternative size favicons), etc.
What I can make work is favicon.ico, adding it to grails-app/assets/images and using the asset pipeline in the GSP:
But the rest doesn't work. Also site.webmanifest and browserconfig.xml files have paths to certain images to be used as Android icons or Windows tiles respectively. I can change those paths to be under /assets/... but those files should be available under the Grails app root.
Looked in the docs and tried to find examples online but couldn't find anything for Grails 3.
How can I configure Grails to allow those files to be accessed from the app's root path?
BTW I'm using Grails 3.2.9
grails
add a comment |
I have an Grails app that runs on http://localhost:8092
Different browsers look for certain files in the root path (http://localhost:8092/), for instance: favicon.ico, browserconfig.xml (looks for ms tiles on Windows), site.webmanifest (looks for icons + app name on Android that is used when adding the web app to home screen), safari-pinned-tab.svg (for Safari), favicon-32x32.png/favicon-16x16.png (for alternative size favicons), etc.
What I can make work is favicon.ico, adding it to grails-app/assets/images and using the asset pipeline in the GSP:
But the rest doesn't work. Also site.webmanifest and browserconfig.xml files have paths to certain images to be used as Android icons or Windows tiles respectively. I can change those paths to be under /assets/... but those files should be available under the Grails app root.
Looked in the docs and tried to find examples online but couldn't find anything for Grails 3.
How can I configure Grails to allow those files to be accessed from the app's root path?
BTW I'm using Grails 3.2.9
grails
I have an Grails app that runs on http://localhost:8092
Different browsers look for certain files in the root path (http://localhost:8092/), for instance: favicon.ico, browserconfig.xml (looks for ms tiles on Windows), site.webmanifest (looks for icons + app name on Android that is used when adding the web app to home screen), safari-pinned-tab.svg (for Safari), favicon-32x32.png/favicon-16x16.png (for alternative size favicons), etc.
What I can make work is favicon.ico, adding it to grails-app/assets/images and using the asset pipeline in the GSP:
But the rest doesn't work. Also site.webmanifest and browserconfig.xml files have paths to certain images to be used as Android icons or Windows tiles respectively. I can change those paths to be under /assets/... but those files should be available under the Grails app root.
Looked in the docs and tried to find examples online but couldn't find anything for Grails 3.
How can I configure Grails to allow those files to be accessed from the app's root path?
BTW I'm using Grails 3.2.9
grails
grails
edited Aug 29 '18 at 22:27
pfx
5,460122035
5,460122035
asked May 30 '18 at 4:07
Pablo PazosPablo Pazos
1,5461125
1,5461125
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Put all of them in src/main/resources/public
https://gsp.grails.org/latest/guide/resources.html
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
add a comment |
Basing on the release notes:
In order to resolve an issue around how POST requests are treated for
REST applications on non-existent resources, static resources located
in src/main/resources/public are now resolved under the /static/** URI
by default, instead of the base URI /**. If you wish to restore the
previous behaviour add the following configuration:
grails.resources.pattern = '/**'
It's also resolving issue (even for rest-api profile app) with:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'grailsDispatcherServlet'
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50596240%2fgrails-3-how-to-access-favicon-icon-and-tile-files-from-app-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Put all of them in src/main/resources/public
https://gsp.grails.org/latest/guide/resources.html
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
add a comment |
Put all of them in src/main/resources/public
https://gsp.grails.org/latest/guide/resources.html
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
add a comment |
Put all of them in src/main/resources/public
https://gsp.grails.org/latest/guide/resources.html
Put all of them in src/main/resources/public
https://gsp.grails.org/latest/guide/resources.html
answered Jun 1 '18 at 5:07
Jorge Aguilera GonzalezJorge Aguilera Gonzalez
27627
27627
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
add a comment |
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
Created a file in /src/main/resources/public/browserconfig.xml then on localhost:8092/browserconfig.xml I get Error: Page Not Found (404) Path: /browserconfig.xml. I believe the file is served from /static not from /
– Pablo Pazos
Jun 13 '18 at 0:25
add a comment |
Basing on the release notes:
In order to resolve an issue around how POST requests are treated for
REST applications on non-existent resources, static resources located
in src/main/resources/public are now resolved under the /static/** URI
by default, instead of the base URI /**. If you wish to restore the
previous behaviour add the following configuration:
grails.resources.pattern = '/**'
It's also resolving issue (even for rest-api profile app) with:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'grailsDispatcherServlet'
add a comment |
Basing on the release notes:
In order to resolve an issue around how POST requests are treated for
REST applications on non-existent resources, static resources located
in src/main/resources/public are now resolved under the /static/** URI
by default, instead of the base URI /**. If you wish to restore the
previous behaviour add the following configuration:
grails.resources.pattern = '/**'
It's also resolving issue (even for rest-api profile app) with:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'grailsDispatcherServlet'
add a comment |
Basing on the release notes:
In order to resolve an issue around how POST requests are treated for
REST applications on non-existent resources, static resources located
in src/main/resources/public are now resolved under the /static/** URI
by default, instead of the base URI /**. If you wish to restore the
previous behaviour add the following configuration:
grails.resources.pattern = '/**'
It's also resolving issue (even for rest-api profile app) with:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'grailsDispatcherServlet'
Basing on the release notes:
In order to resolve an issue around how POST requests are treated for
REST applications on non-existent resources, static resources located
in src/main/resources/public are now resolved under the /static/** URI
by default, instead of the base URI /**. If you wish to restore the
previous behaviour add the following configuration:
grails.resources.pattern = '/**'
It's also resolving issue (even for rest-api profile app) with:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'grailsDispatcherServlet'
edited Nov 22 '18 at 21:20
answered Nov 22 '18 at 21:03
Michal_SzulcMichal_Szulc
2,29832145
2,29832145
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50596240%2fgrails-3-how-to-access-favicon-icon-and-tile-files-from-app-root%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown