jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Support arbitrary Handlers and core webapp archives in core-deploy

Open joakime opened this issue 5 months ago • 0 comments
trafficstars

Jetty version(s) 12.1.0.beta0

Enhancement Description The core-deploy creates a CoreContextHandler before executing XML for the sole reason to create a classloader for that deployment.

This initial CoreContextHandler conflicts with arbitrary ContextHandler creation in XML at a later step.

If you have an XML in 12.0.x like the following ...

$JETTY_BASE/webapps/moved.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">

<!-- Simple handler to redirect from old path to new -->
<Configure class="org.eclipse.jetty.server.handler.MovedContextHandler">
  <Set name="contextPath">/oldContextPath</Set>
  <Set name="redirectURI">/test/dump/moved</Set>
  <Set name="statusCode">302</Set>
  <Set name="discardPathInContext">false</Set>
  <Set name="discardQuery">false</Set>
  <Set name="cacheControl">no-cache</Set>
</Configure>

Then this results in an error that org.eclipse.jetty.server.handler.MovedContextHandler is not a org.eclipse.jetty.server.handler.CoreContextHandler.

If we rework the pre-XML initialization to not be a ContextHandler then this should work again.

joakime avatar Jun 05 '25 16:06 joakime