Tomcat 9.0.65
Hello I have some problems with redirects by requests without trailing slashes.
 
When I try to get to the page for example: "about/page" tomcat understands that 
it is necessary to add a slash and adds it, however, he also adds the name of 
the root folder to this, that is, the url "lundase/about/page/" turns out, and 
any requests to our server via apache are proxied with the addition of 
"lundase", so it turns out that we are accessing the application on request 
"lundase/lundase/about/page/" which results in a 404 status.
 
I googled it and found two properties:  
context.setMapperContextRootRedirectEnabled(false)
context.setMapperDirectoryRedirectEnabled(false)
And tryed to play with them, however, it's not resolve my problem please can 
you help me with it?
 
<?xml version="1.0" encoding="UTF-8"?>
<web-app >
<display-name>Main lundagrossisten site</display-name>
<description>lundagrossisten.se web application</description>
<session-config>
<session-timeout>1</session-timeout>
<cookie-config>
<max-age>0</max-age>
</cookie-config>
</session-config>

<servlet>
<servlet-name>client-error-logging-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.ClientErrorLoggingServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>client-error-logging-servlet</servlet-name>
<url-pattern>/client-error/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>warehouses-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.WarehousesServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>warehouses-servlet</servlet-name>
<url-pattern>/warehouses/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>propsforrent-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.PropertiesForRentServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>propsforrent-servlet</servlet-name>
<url-pattern>/properties-for-rent/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>calendar-events-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.CalendarEventsServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>calendar-events-servlet</servlet-name>
<url-pattern>/about/events/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>update-catalogue-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.UpdateCatalogueServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>update-catalogue-servlet</servlet-name>
<url-pattern>/ping/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>catalogue-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.CatalogueServlet
</servlet-class>
<init-param>
<param-name>catalogue-type</param-name>
<param-value>MAIN</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>catalogue-servlet</servlet-name>
<url-pattern>/catalogue/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>binary-data-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.BinaryDataServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>binary-data-servlet</servlet-name>
<url-pattern>/binary/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>content-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.ContentServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>content-servlet</servlet-name>
<url-pattern>/content/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>cabinet-servlet</servlet-name>
<servlet-class>com.gridnine.platform.server.lundase.web.servlet.CabinetServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>cabinet-servlet</servlet-name>
<url-pattern>/lundaprogrammet/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>/source/assets/css/aggregate.css</url-pattern>
</servlet-mapping>

<filter>
<filter-name>auth-filter</filter-name>
<filter-class>com.gridnine.platform.server.lundase.web.servlet.AuthFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>auth-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<error-page>
<location>/error.html</location>
</error-page>

<request-character-encoding>UTF-8</request-character-encoding>
</web-app>
 
The code that doing this redirects:
org.apache.catalina.mapper.Mapper.internalMapWrapper(ContextVersion 
contextVersion,
                                          CharChunk path,
                                          MappingData mappingData)
---
Fedor Makarov

Reply via email to