Java Reading Undecoded URL from Servlet

前端 未结 5 980
误落风尘
误落风尘 2021-02-10 02:32

Let\'s presume that I have string like \'=&?/;#+%\' to be a part of my URL, let\'s say like this:

example.com/servletPath/someOtherPath/myString/something.ht         


        
5条回答
  •  孤城傲影
    2021-02-10 02:55

    It seems like you are trying to do something RESTy (use Jersey). Can's you just parse off the leading and trailing parts of the URL to get the data you are looking for?

    url.substring(startLength, url.length - endLength);

提交回复
热议问题