Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.
Level 1
Level 2
Melden Sie sich an, um alle Badges zu sehen
Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.
Hello,
I am attempting to create a custom error page for my company's website. I followed the instructions found in http://docs.adobe.com/docs/en/cq/current/developing/customizing_error_handler_pages.html. Although my error page does appear as expected, it does not mimic the appearance of the rest of the site. Is there a way to apply my site's template to the custom error page?
Thanks,
Sarah
Gelöst! Gehe zu Lösung.
Zugriffe
Antworten
Likes gesamt
Yes, you create a template and corresponding page component. Once you have this create a page with this template, you can hide in navigation so as not to be picked up by navigation component.
Your page will be having a path like /content/yourapp/en/404.html
In your /apps/sling/servlet/errorhandler/404.jsp
You can have code like this to redirect to your custom page
String uri = request.getRequestURI();
if(uri.matches("(/content/yourapp/en/)(.*)"))
{
pageContext.include("/content/yourapp/en/404.html");
} else if(uri.matches("(/content/yourapp/es/)(.*)"))
{
...
}
Zugriffe
Antworten
Likes gesamt
Yes, you create a template and corresponding page component. Once you have this create a page with this template, you can hide in navigation so as not to be picked up by navigation component.
Your page will be having a path like /content/yourapp/en/404.html
In your /apps/sling/servlet/errorhandler/404.jsp
You can have code like this to redirect to your custom page
String uri = request.getRequestURI();
if(uri.matches("(/content/yourapp/en/)(.*)"))
{
pageContext.include("/content/yourapp/en/404.html");
} else if(uri.matches("(/content/yourapp/es/)(.*)"))
{
...
}
Zugriffe
Antworten
Likes gesamt
Thanks! That worked perfectly! Unfortunately, when I include the page in my 404.jsp script, the page is missing all of the i18n files. The labels are all messed up. How can I include the i18n files through the 404.jsp file?
Zugriffe
Antworten
Likes gesamt
I am not sure how you are doing translations, do you have absolute path for the files you are including in the jsp file.
Please check the template and corresponding jsp by directly invoking instead of through 404.jsp
Zugriffe
Antworten
Likes gesamt
I'm sorry for the delayed reply! When I invoke the template directly (through site admin) the i18n labels appear as expected. However, when I access the page through the 404.jsp file (by typing the url incorrectly) the labels are missing.
Zugriffe
Antworten
Likes gesamt
formis17 wrote...
I'm sorry for the delayed reply! When I invoke the template directly (through site admin) the i18n labels appear as expected. However, when I access the page through the 404.jsp file (by typing the url incorrectly) the labels are missing.
Zugriffe
Antworten
Likes gesamt
Zugriffe
Likes
Antworten