My web is hosted in Centos under Tomcat. The web worked fine. (no web.xml in WEB-INF)
I wanted to make a permalink for jsp pages using urlrewritefilter-4.0.4.jar But after upload, the address web.com/COVID-19 showed 404.
This is my web.xml (Default)
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
</web-app>
This is my urlrewrite.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN" "http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
<rule>
<from>/COVID-19</from>
<to>/covid19.jsp</to>
</rule>
</urlrewrite>
Please help, thank you.
So, when I am taking a dump contemplating late in the midnight after struggling hours and hours into desperation, I was enlightened.
The reason that urlrewritefilter didn't work was because Tomcat really had nothing to response to. It was the Apache, it only forwarded url to Tomcat which ended in *.jsp and servlet (mod_jk). So it's only natural Tomcat didn't get any url ended with "COVID-19" as it was handled by Apache.
I modified the config, and now it's running smooth. Thank God.