Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

SV: [jdom-interest] One less TODO item

Per Norrman

2003-10-07

Replies:

I can understand the redirect issue. I didn't realize the
HTTP GET problem, and you're obvioulsy correct. Then, shouldn't
URLConnection#getUrl reflect this fact, even in the absent path
case?

A quick test:
 
   public static void main(String[] args) throws Exception {
   
   
    testURLConnection("http://www.ibm.com");
    testURLConnection("http://www.ibiblio.org/xml");
    testURLConnection("http://www.cafeconleche.org");
 }

 private static void testURLConnection(String uri)
   throws MalformedURLException, IOException {
   URL url = new URL(uri);
   URLConnection conn = url.openConnection();
       conn.getContent();
   System.out.println(conn.getURL().toExternalForm());
 }

produces

 http://www.ibm.com/us/
 http://www.ibiblio.org/xml/
 http://www.cafeconleche.org

Obviously, URLConnection records the redirects that are happening, but not
that it determined to supply the trailing slash on its own. Is this a bug in
URLConnection?

/pmn

> -----Ursprungligt meddelande-----
> Från: jdom-interest-admin@(protected)
> [mailto:jdom-interest-admin@(protected)
> Skickat: den 7 oktober 2003 20:53
> Till: Per Norrman
> Kopia: jdom-interest@(protected)
> Ämne: Re: SV: SV: [jdom-interest] One less TODO item
>
>
> At 2:07 PM -0400 10/7/03, Elliotte Rusty Harold wrote:
>
> >I'm not sure if Xerces is correctly updating the XML parser with the
> >actual redirected base URI or not. I should write a test case for
> >that and find out.
> >
>
> I've now written the test case. See
> http://www.cafeconleche.org/redirecttest.xml
> (with validation turned on to make sure the DTD loads). Xerces is
> *not* using the right base URI. libxml gets this wrong too. I'll file
> the bug with Apache.
>
> Hmm, looks like I already did. See
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20383
> Bugzilla says it was fixed in CVS a couple of weeks after the release
> of Xerces-J 2.5, so presumably the fix will show up in 2.6 which last
> I heard was due in November.
>
> Once that's done, all JDOM should need to do is bundle Xerces 2.6 or
> later and make sure it's used instead of the JDK default parser and
> this should all take care of itself.
>
> --
>
>   Elliotte Rusty Harold
>   elharo@(protected)
>   Processing XML with Java (Addison-Wesley, 2002)
>   http://www.cafeconleche.org/books/xmljava
>   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr@(protected)

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.