jetty.xml

jetty.xml is a Lycia configuration file (= a servlet container) used for configuring Jetty web server.

With Jetty, jetty.xml can be used to configure:

In Lycia, jetty.xml is most often used to specify the location for your public client-side resources.

Attention: When you uninstall Lycia with QPM, Lycia configuration folders are deleted.

This means that you must back up your jetty.xml before uninstalling Lycia. Otherwise, they will be deleted.

How to create jetty.xml

Querix Package Manager doesn't create jetty.xml.

So, if you want to work with public client-side resources in Lycia, you must first create this file.

To create jetty.xml, follow these steps:

Step 1. Stop Lycia Web Server.

Step 2. Open your favorite text editor.

Step 3. Copy the template given below to a new text file.

Step 5. In this block, change the id, context path, and resource base.

Step 8. Start Lycia Web Server.

You have to restart Lycia Web Server every time when you update your existing jetty.xml as well.

You can specify several folders for your public client-side resources. But these folders must be defined one-by-one in its separate context configuration block and need one new handler for each folder.

Structure of jetty.xml

jetty.xml is a file with a strict structure. This means that all its tags are compulsory and only some of them can be configured.

Here is a template of your future jetty.xml:

<?xml version="1.0"?>

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<Configure id="JettyServer"class="org.eclipse.jetty.server.Server">

  <Set name="connectors">

    <Array type="org.eclipse.jetty.server.Connector">

      <Item>

        <New class="org.eclipse.jetty.server.ServerConnector">

          <Arg><Ref refid="JettyServer"/></Arg>

          <Set name="port">8787</Set>

        </New>

      </Item>

    </Array>

  </Set>

 

<!--

  <New id="..." class="org.eclipse.jetty.server.handler.ContextHandler">

    <Set name="contextPath">...</Set>

      <Set name="handler">

        <New class="org.eclipse.jetty.server.handler.ResourceHandler">

          <Set name="resourceBase">...</Set>

          <Set name="directoriesListed">true</Set>

        </New>

      </Set>

    </New>

-->

 

  <Set name="handler">

    <New id ="contextHandlerConnection" class="org.eclipse.jetty.server.handler.HandlerCollection">

      <Set name="handlers">

        <Array type="org.eclipse.jetty.server.Handler">

<!--

          <Item>

            <Ref refid="context" />

          </Item>

-->

        </Array>

      </Set>

    </New>

  </Set>

</Configure>

There are only four customizable tags in this template:

id or refid

is the identifier of the context

name="contextPath"

is a URL prefix that identifies the context to which the incoming request is passed.

If the contextPath is /public, the webserver will handle requests to /public/lycia.png, /public/images/, and /public/images/lycia.png but will not handle requests to /, /images, or /images/lycia.png.

name="resourceBase"

is a folder that stores public client-side resources

Here is an example of how you can change these tags:

  <New id="context" class="org.eclipse.jetty.server.handler.ContextHandler">

    <Set name="contextPath">/public</Set>

    <Set name="handler">

      <New class="org.eclipse.jetty.server.handler.ResourceHandler">

        <Set name="resourceBase">C:\ProgramData\Querix\Lycia\progs\public</Set>

        <Set name="directoriesListed">true</Set>

      </New>

    </Set>

  </New>

 

  <Set name="handler">

     ...

          <Item>

            <Ref refid="context"/>

          </Item>

     ...

  </Set>

 

 

Contact Us

Privacy Policy

Copyright © 2026 Querix, (UK) Ltd.