<div dir="ltr">Thanks for the reply Stuart.  I&#39;ve tried this with no success, but perhaps I&#39;m doing it wrong.<div><br><font face="monospace" color="#0000ff">List&lt;PredicatedHandler&gt; ph = PredicatedHandlersParser.parse(predicatesLines, _classLoader);<br>servletBuilder.addOuterHandlerChainWrapper(next -&gt; Handlers.predicates(ph,next));</font><br></div><div><br></div><div>When the response-code handler fires, I still get no response body.</div><div><br></div><div>On a related note, when I move the predicates into an outer handler chain wrapper, my default response listener also doesn&#39;t fire at all.  </div><div><br></div><div>On an unrelated train of thought, I&#39;ve been trying to see if I can get the default response listener to automatically dispatch the correct error page, but that hasn&#39;t been going well either.  If I don&#39;t use the outer handler chain idea, but try to capture the empty response in a default response listener, I can return a static message using the Sender class</div><div><br></div><div><font color="#0000ff" face="monospace">Sender sender = exchange.getResponseSender();<br>sender.send(errorHTMLString);</font><br></div><div><br></div><div>But if I try to run something this in my default response listener to invoke my error pages</div><div><br></div><div><font face="monospace" color="#0000ff">ServletRequestContext src = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);<br>HttpServletResponseImpl response = src.getOriginalResponse();<br>response.doErrorDispatch( exchange.getStatusCode(), exchange.getReasonPhrase() );</font><br></div><div><br></div><div>Then it&#39;s as though nothing happens and I still get an empty response.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div></div><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><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 2, 2020 at 6:17 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com">sdouglas@redhat.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"><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" target="_blank">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>
</blockquote></div>