Brackets in a Request URL are legal but not in a URI (Java)?
问题 Apparently brackets are not allowed in URI paths. I'm not sure if this is a Tomcat problem but I'm getting request with paths that contains ] . In otherwords request.getRequestURL() == "http://localhost:8080/a]b" request.getRequestURI() == "/a]b" BTW getRequestURL() and URI are generally escaped ie for http://localhost:8080/a b request.getRequestURL() == "http://localhost:8080/a%20b" So if you try to do: new URI("http://localhost:8080/a]b") new URI(request.getRequestURL()) It will fail with a