# Return error pages as JSON

**URL:** <https://community.bloomreach.com/t/return-error-pages-as-json/3590>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [December 30, 2022, 10:09am UTC](https://community.bloomreach.com/t/return-error-pages-as-json/3590 "2022-12-30T10:09:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Lop](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@Francisco\_Javier\_Lop](https://community.bloomreach.com/u/Francisco_Javier_Lop)\
**Post date:** [December 30, 2022, 10:09am UTC](https://community.bloomreach.com/t/return-error-pages-as-json/3590/1 "2022-12-30T10:09:13Z")

</div>

Hi all

we’re working in a headless project and we would want to return the error pages configured in the “web.xml” file as a JSON matching the format returned under the “resourceapi” URL for the rest of the pages

is there a way to configure the jsp files to return a json formatted file insteald of an html page?

thanks in advance

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [January 10, 2023, 8:44am UTC](https://community.bloomreach.com/t/return-error-pages-as-json/3590/2 "2023-01-10T08:44:56Z")

</div>

the web.xml error pages are served by tomcat. When you get those the hst is not involved. This is also why they have to be jsp’s, that’s how tomcat works. In most cases you shouldn’t ever hit those error pages, so I’m wondering what the case is here?
