AEM Spa editor - Error Page handling

One of the questions we frequently got from customers was on how to handle 404 / 500 pages in the SPA editor.

Unfortunately we could not give a good answer, and it required a lot of hacking to make it work.



Thats why just now, we updated the spa page model manager to support handling 404 / 500 pages! 

It works like this:

  1. Page Request is made and ACS AEM error handler catches it.
  2. Client tries to fetch a model JSON but get's a 404 error in return.
  3. Client now will take the error page root (given as meta property) and use the status code to make a new request. 
  4. Presuming the page exists, the authored error page model JSON is injected as requested path. 
  5. The error page is displayed.
Result:

Check out the repository providing a demo:

https://github.com/niekraaijmakers/aem-spa-editor-errorpages-example

happy coding!



Reacties

Populaire posts van deze blog

AEM SPA editor - FAQ

Archetype update 28: SPA editor