Ivan Mirchev
Ivan Mirchev

Reputation: 73

Jetty-web.xml values not used

I am using Jetty 9.2.9 in which I am deploying some amount of apps. Without giving here any configuration files, can you think of any reason why the jetty-web.xml is read and use in only the first app which is deployed? In the other apps in WEB-INF/jetty-web.xml is read, if it is malformed I have an exception, but the values are not applied to this web app. I am trying to override maxFormKeys and maxFormContentSize, my jetty-web.xml looks like this

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="maxFormKeys">2000</Set>
    <Set name="maxFormContentSize">211111</Set>
</Configure>

I know this is hard, but since the project is massive it would be better if somebody has some overall guidelines to point me in a direction to think, instead of trying to find exact solution. Thanks in advance.

Upvotes: 2

Views: 632

Answers (2)

Alex78191
Alex78191

Reputation: 3066

You had to change the maven command from mvn clean jetty:run to mvn clean jetty:run-war in order to run an assembled webapp on the embedded jetty in which the deployment descriptor gets also filtered.

https://stackoverflow.com/a/17188462/4854931

Upvotes: 0

Lachlan
Lachlan

Reputation: 406

Take a look the documentation the jetty documentation, specifically: https://www.eclipse.org/jetty/documentation/current/setting-form-size.html. This section describes the different ways to set this configuration for an individual webapp vs for all webapps deployed on the server.

You should also upgrade your Jetty version to the latest version if possible, Jetty 9.2 is very old and is End-Of-Life, so this might be an issue with using that version, the current version is 9.4.28 at the moment.

Upvotes: 1

Related Questions