WEM 8.5 - How to send an error while executing a content component's display view jsp

Hi Experts,

I'm just curious about the error handling in a JSP (display view):
Usually, you can force an error page by invoking something like:

${pageContext.response.sendError(404)}

In WEM it does not work (or at least it does not work for me).
Do you know how to handle this correctly?
At a certain condition in a display view, I would like to abort the execution and send an error to the client.
The WEM error handling seems to isolate errors within it's content components. How can I force an all-embracing error and abort execution to show a 404 status code (for example)?

Thanks,
Sagar Sunkar.

Comments

  • WEM has its own component model. Thus when you are dealing with HTTP request object in a component or region scope you are dealing with is not original HttpRequest object for the servlet. Thus operation like what you mentioned will not work, the idea of a component framework is compartmentalize errors so they error do not impact the full page rendering.

    one way to do what you want is to write out a JavaScript on the page with redirect logic.