Changing backslash behavior on Tomcat / Coyote

I host a series of REST services on a tomcat server, and many of them can use backslash \ as part of the object identifier, as in http://server/entitype/id\of\the\entitythatcan/have/forwardslashes/too

Now tomcat, as I discovered, provides no way to change the two default behaviors, either return the error to the backslash found at the URL, or replace \ with forwardlash. See http://www.docjar.com/html/api/org/apache/coyote/tomcat5/CoyoteAdapter.java.html Line 735

Is there any hope of changing this without having to create a custom tomcat assembly?

+4
source share
2 answers

It is impossible to do this, I refused this for a long time and suggested that others find their workaround.

+1
source

Take a look at the system property org.apache.catalina.connector. CoyoteAdapter.ALLOW_BACKSLASH org.apache.catalina.connector. CoyoteAdapter.ALLOW_BACKSLASH on Tomcat System Properties Reference (note that the link is for Tomcat 7: you will have to look at the TC6 documentation if you use TC6 to see if this option exists).

+2
source

All Articles