Hello,
We have implemented ACS Error Handler for our project. Lets say that my hierarchy starts from "/content/myproject" and we have set the errorPages property on "myproject" page then the ACS error handler works fine for all the pages UNDER "myproject". How do we make it work for POST requests on content pages where we get 500 or 403 errors?
Example: How do I set the error handler for POST on URLs like "http://www.mysite.com/any-page.html" ?
Solved! Go to Solution.
ACS Commons Error Page Handler works fine for POSTs as well. If an error occurs, Sling handles the error and passes it off to the ACS Commons Error Page handle, which in turn internally makes a HTTP GET request for the error page defined by the @errorPages property.
The problem your running into it seems, is you are making POSTs that may "error" (403/500) to paths that dont reside under a hierarchy that that defines a @errorPages, thus the error page to display is ambiguous.
You can set a "System" default for ACS Commons error page handler via OSGi configuration which is described in the ACS Commons Error Page Handler documentation; this can be used to surface error pages for request where a @errorPages cannot be found.
...
Taking a step back, its better practice to bind your POST actions to actual content resources, rather than to arbitrary content endpoints or path-based servlets.
For example:
Good: HTTP POST /content/my-project/actionable-page.some-action.html
Bad: HTTP POST /some-action.html
Hi
See the comments here - : https://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html
// Increasing the Response buffer size in Apache Felix Jetty Based HTTP Service to 49152 fixed it.
Also you can you post your question directly in the comment section of the page.
I hope this would help you.
~kautuk
Views
Replies
Total Likes
ACS Commons Error Page Handler works fine for POSTs as well. If an error occurs, Sling handles the error and passes it off to the ACS Commons Error Page handle, which in turn internally makes a HTTP GET request for the error page defined by the @errorPages property.
The problem your running into it seems, is you are making POSTs that may "error" (403/500) to paths that dont reside under a hierarchy that that defines a @errorPages, thus the error page to display is ambiguous.
You can set a "System" default for ACS Commons error page handler via OSGi configuration which is described in the ACS Commons Error Page Handler documentation; this can be used to surface error pages for request where a @errorPages cannot be found.
...
Taking a step back, its better practice to bind your POST actions to actual content resources, rather than to arbitrary content endpoints or path-based servlets.
For example:
Good: HTTP POST /content/my-project/actionable-page.some-action.html
Bad: HTTP POST /some-action.html
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies