<?xml version="1.0" encoding="UTF-8"?>
<web-app
  xmlns="https://jakarta.ee/xml/ns/jakartaee"
  xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
  xmlns:web="https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
  xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
  version="5.0"
>

  <!-- ========================================================== -->
  <!-- General -->
  <!-- ========================================================== -->

  <!-- Name the application -->
  <display-name>PlantUML</display-name>
  <description>PlantUML Online Server</description>

  <!-- This app is cluster-ready -->
  <distributable />

  <!-- Set timeout to 120 minutes -->
  <session-config>
    <session-timeout>120</session-timeout>
  </session-config>


  <!-- ========================================================== -->
  <!-- Custom Tag Libraries -->
  <!-- ========================================================== -->

  <!-- Taglib declarations are no longer required since JSP 2.0, see Removing taglib from web.xml -->
  <!-- The <taglib> did not need to be a child of <jsp-config> in earlier versions but is required as of Tomcat 7 -->
  <!-- Note that you can only have one <jsp-config> element per web.xml -->
  <!--
  <jsp-config>
    <taglib>
      <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
      <taglib-location>/WEB-INF/lib/c.tld</taglib-location>
    </taglib>
  </jsp-config>
  -->


  <!-- ========================================================== -->
  <!-- Context Parameters -->
  <!-- ========================================================== -->

  <context-param>
    <param-name>org.eclipse.jetty.servlet.Default.welcomeServlets</param-name>
    <param-value>exact</param-value>
  </context-param>


  <!-- ========================================================== -->
  <!-- Servlets -->
  <!-- ========================================================== -->

  <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.eclipse.jetty.jsp.JettyJspServlet</servlet-class>
    <init-param>
      <param-name>compilerSourceVM</param-name>
      <param-value>1.8</param-value>
    </init-param>
    <init-param>
      <param-name>compilerTargetVM</param-name>
      <param-value>1.8</param-value>
    </init-param>
  </servlet>

  <servlet>
    <servlet-name>plantumlservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.PlantUmlServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>plantumlservlet</servlet-name>
    <url-pattern>/welcome</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>plantumlservlet</servlet-name>
    <url-pattern>/uml/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>plantumlservlet</servlet-name>
    <url-pattern>/form</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>plantumlservlet</servlet-name>
    <url-pattern>/start/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>imgservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.ImgServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>imgservlet</servlet-name>
    <url-pattern>/png/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>imgservlet</servlet-name>
    <url-pattern>/img/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>svgservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.SvgServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>svgservlet</servlet-name>
    <url-pattern>/svg/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>pdfservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.PdfServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>pdfservlet</servlet-name>
    <url-pattern>/pdf/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>epsservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.EpsServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>epsservlet</servlet-name>
    <url-pattern>/eps/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>epstextservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.EpsTextServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>epstextservlet</servlet-name>
    <url-pattern>/epstext/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>base64servlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.Base64Servlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>base64servlet</servlet-name>
    <url-pattern>/base64/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>asciiservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.AsciiServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>asciiservlet</servlet-name>
    <url-pattern>/txt/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>proxyservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.ProxyServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>proxyservlet</servlet-name>
    <url-pattern>/proxy</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>oldproxyservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.OldProxyServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>oldproxyservlet</servlet-name>
    <url-pattern>/proxy/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>mapservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.MapServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>mapservlet</servlet-name>
    <url-pattern>/map/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>checkservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.CheckSyntaxServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>checkservlet</servlet-name>
    <url-pattern>/check/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>languageservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.LanguageServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>languageservlet</servlet-name>
    <url-pattern>/language</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>asciicoderservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.AsciiCoderServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>asciicoderservlet</servlet-name>
    <url-pattern>/coder/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>plantumluihelperservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.PlantUmlUIHelperServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>plantumluihelperservlet</servlet-name>
    <url-pattern>/ui-helper/*</url-pattern>
  </servlet-mapping>

  <servlet>
    <servlet-name>metadataservlet</servlet-name>
    <servlet-class>net.sourceforge.plantuml.servlet.MetadataServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>metadataservlet</servlet-name>
    <url-pattern>/metadata/*</url-pattern>
  </servlet-mapping>

  <!-- ========================================================== -->
  <!-- Error Handler -->
  <!-- ========================================================== -->

  <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/error.jsp</location>
  </error-page>

  <error-page>
    <error-code>500</error-code>
    <location>/error.jsp</location>
  </error-page>


  <!-- ========================================================== -->
  <!-- Welcome Files -->
  <!-- ========================================================== -->

  <welcome-file-list>
    <welcome-file>welcome</welcome-file>
  </welcome-file-list>

</web-app>
