сб, 20 июл. 2019 г. в 17:47, Richard Huntrods <huntr...@athabascau.ca>:
>
> OK. That was really weird.
>
> As I said in my message, following the directions on the web did NOT
> work. It didn't force redirection from http to https.
>
> What it DID end up doing was to kill the tomcat servlet application.
> Before the change it was working fine, and after the change it would
> only generate a 404 page.
>
> I reverted to the original /conf/web.xml, restarted tomcat and the
> servlet application is back up and running perfectly.
>
> So this code in /conf/web.xml affected the servlet but not the ROOT
> static web pages.

1. The web.xml file and its behavior are defined in the Servlet Specification.

Some random instructions on the net have to be used carefully.

2. The web.xml file is the one in your web application (WEB-INF/web.xml).

The /conf/web.xml file provides defaults for all web applications, and
SHOULD not be edited. (The /conf/context.xml should not be exited as
well. That is another frequent error.).

Those defaults are merged with the web.xml file of your web
application using merging rules defined in the Servlet Specification.

There is an option, "logEffectiveWebXml" [1] that turns on logging of
the merged web.xml file.

3. Beware of typos.

The tag "</web-recource-collection>" is misspelled.

There is an option, "xmlValidation" [1] that turns on automatic
validation of web.xml against the XML schema specified in that file.

(Personally, I usually run with
org.apache.catalina.STRICT_SERVLET_COMPLIANCE=true
and that turns "xmlValidation" on as well).

4. Top-posting is bad.

[1] http://tomcat.apache.org/tomcat-9.0-doc/config/context.html

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to