It's complicated. You are limited by the conventions of Tomcat and other containers, so there is no easy solution.
web.xml / JSP .war <load-on-startup>
. , .war WEB-INF/web.xml . , JSP /, .
, , .war , web.xml, , . , .war . script, .war web.xml web.xml.
, script .war, script, WEB-INF/web.xml .war, <load-on-startup>
<servlet>
.war . , Tomcat, bash script, :
#!/bin/sh
TEMPDIR=/tmp/temp$$
WARFILE=/path-to-tomcat/webapps/foo.war
mkdir -p $TEMPDIR/WEB-INF
pushd $TEMPDIR
unzip -qq -c $WARFILE WEB-INF/web.xml \
| sed 's#</servlet>.*#<load-on-startup>99</load-on-startup></servlet>#' \
> WEB-INF/web.xml
zip -f $WARFILE WEB-INF/web.xml
popd
rm -rf $TEMPDIR
script - , Tomcat. , .