3 Replies Latest reply: Jul 27, 2011 8:52 AM by 853792 RSS

    Java URI changes in JDK 1.5 vs JDK 1.4

    853792
      import java.net.*;
      
      public class TestURI {
           public static void main(String args[]) throws URISyntaxException
           {
              String first = new String("foo");
              String second = new String("bar");
              String third = new String("[space or another space]");
      
              URI temp = new URI(first, second, third);
              System.out.println(temp.getFragment());
      
           }
      }
      When I run the above code in JDK 1.4, I get

      [space or another space]

      When I run the same code in JDK 1.5/1.6, I get the following:

      [space%20or%20another%20space]


      Could somebody tell me what changed?

      Thanks,
      Raj

      Edited by: Raj on Jul 27, 2011 7:17 AM