1,转义

 @org.junit.Test
    public void testEncode(){
        String url="http://192.168.0.19:8888/cas/login";
        String urlEncodee= URLEncoder.encode(url);
        System.out.println(urlEncodee);
    }

2,反转义

   @Test
    public void testDecode(){
        String url="http%3A%2F%2F192.168.0.19%3A8888%2Fcas%2Flogin";
        String urlDecode= URLDecoder.decode(url);
        System.out.println(urlDecode);
    }

相关文章:

  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-07-27
  • 2021-09-19
  • 2021-09-20
相关资源
相似解决方案