<div dir="ltr"><div>The predicate languages are executed before the Servler handlers, so they won&#39;t be handled by Servlet error pages.</div><div><br></div><div>If you are setting this all up programmatically you could use io.undertow.servlet.api.DeploymentInfo#addOuterHandlerChainWrapper to setup the predicate handler after the initial servlet one, which should mean that the servlet error handling will handle the response code.</div><div><br></div><div>Stuart<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 3 Jul 2020 at 08:25, Brad Wood &lt;<a href="mailto:bdw429s@gmail.com">bdw429s@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">When I configure an error page similar to this:<div><br></div><div><font face="monospace" color="#0000ff">servletBuilder.addErrorPage( new ErrorPage( &quot;404.html&quot;, 404));</font><br></div><div><br></div><div>This works great when I hit a path in my browser that doesn&#39;t exist.  The contents of the <b>404.html</b> file is served with a response code of <b>404</b>.</div><div><br></div><div>However, if I also use the predicate language to define something like:</div><div><br></div><div><font face="monospace" color="#0000ff">path(/box.json)-&gt;response-code(404)</font><br></div><div><br></div><div>and then I hit <b>localhost/box.json</b> in my browser, I get a <b>404</b> status code but with no response body. </div><div><ul><li>The docs say the response-code handler ends the exchange, but should it still respect the error pages?<br></li><li>How can I modify my use of Undertow to respect the error pages when using the response-code handler?</li><li>I&#39;ve seen in the docs the ability to have a <b>addDefaultResponseListener()</b> but I&#39;m not sure if it is the correct solution for this, nor how I would access the error page configuration dynamically as to not need to duplicate my work.</li></ul></div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>Thanks!</div><div><br></div><div>~Brad</div><div><br></div><div><b>Developer Advocate</b></div><div><i>Ortus Solutions, Corp </i></div><div><b><br></b></div><div>E-mail: <a href="mailto:brad@coldbox.org" target="_blank">brad@coldbox.org</a></div><div>ColdBox Platform: <a href="http://www.coldbox.org" target="_blank">http://www.coldbox.org</a> </div><div>Blog: <a href="http://www.codersrevolution.com" target="_blank">http://www.codersrevolution.com</a></div><div><br></div></div></div></div></div></div></div></div>
_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a></blockquote></div>