Issue
I've developed a Servlet which is mapped to URLs with the pattern as bellow.
urlPatterns = {"/dv/*" , "/dv/", "/dv*", "/dv/*/*"}
Everything is working like a charm, but i have a major problem with this URL
http://localhost:6070/dv/test/MyProject?=&projectType=auto&{}
, because of existing character "{" or "}" in URL.
How can I deal with this problem?
My web container is Tomcat v8, and I can't avoid from this character in the URL since I'm trying to proxy
a third-party server, and I don't have access to modify the URLs before sending to the Servlet.
Solution
I found the solution.
This problem boils down to Tomcat configuration; Therefore, I added relaxedQueryChars
to my Tomcat's Connector tag, and my problem was solved, but the point is this attribute is just available in Tomcat 8.5.31 or later.
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" maxPostSize="4194304" URIEncoding="UTF-8" bindOnInit="false" server="orca framework" relaxedQueryChars='[]|{}^\`"<>'/>
Answered By - peyman mahdikhani