jetty.xml

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

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 which will be used in LyciaStudio.

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

This means that you must back up your jetty.xml before uninstalling Lycia. Otherwise, it 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 LyciaStudio, you must first create this file.

To create jetty.xml, please follow these steps.

Step 0. Close LyciaStudio (if running).

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 6. Start Lycia Web Server.

Step 9. Start LyciaStudio.

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.

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 © 2024 Querix, (UK) Ltd.