RE: URL validation

2004-06-11 Thread Shapira, Yoav

Hi,

>I had this in the new
>URL(http://4526353&[EMAIL PROTECTED]@##$#$$%(()))*(*&&^%^%^)
and
>it passed.  I was expecting to get some error.  Should I?

No, you shouldn't get an error.  It's a valid but nonsensical URL.  If
you're not clear why this is valid, and are interested, look at RFC
2396.  To summarize: everything after the host in an http URL is
optional.  You have a host name 4526353&*^%$ (to see why the
junk after starting with # is not parsed as part of the host name, refer
to the above RFC, especially the section on encoding escaped sequences).

You can easily confirm java's behavior is consistent with Internet
Explorer and other browsers, by comparing the output from
System.out.println(new URL(the URL above).getHost()) and what happens
when you try to navigate to the above URL in Internet Explore; same
processing, same host name (which if it existed would actually be served
just fine).

In the future, please do a bit more research before making such a bold
claim as the java.net.URL implementation being broken with regard to
HTTP URLs ;)  It had me, for one, worried, and I'm not even a Sun person
;)

Yoav




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: URL validation

2004-06-11 Thread Ikonne, Ike
Hi Yoav,

I had this in the new
URL(http://4526353&[EMAIL PROTECTED]@##$#$$%(()))*(*&&^%^%^) and
it passed.  I was expecting to get some error.  Should I?

Ike

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 08, 2004 3:43 PM
To: Tomcat Users List
Subject: RE: URL validation



Hi,
Can you give examples and/or cases that show java.net.URL doesn't meet
the RFC specifications?

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ikonne, Ike [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 08, 2004 1:52 PM
>To: 'Tomcat Users List'
>Subject: RE: URL validation
>
>Hi Steffen,
>
>Thanks, new URL(url) doesn't work consistently.  I have tried it,
>one can throw in an url that doesn't meet RFC 1738 but URL(url) will
>not catch it.
>
>Thanks,
>
>Ike
>
>
>-Original Message-
>From: SH Solutions [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 08, 2004 12:30 PM
>To: 'Tomcat Users List'
>Subject: RE: URL validation
>
>
>Hi
>
>> Here is my problem, I am looking for a way to syntactically valid a
given
>URL without having to actually creating an URL object.
>
>try {
>  new URL( myUrl );
>  return true;
>} catch ( Throwable t ) {
>  return false;
>}
>
>Why not creating it?
>Javas young generation garbage collection should dispose this
immediatly.
>So
>problem here.
>
>Regards,
>  Steffen
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: URL validation

2004-06-08 Thread Shapira, Yoav

Hi,
Can you give examples and/or cases that show java.net.URL doesn't meet
the RFC specifications?

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ikonne, Ike [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 08, 2004 1:52 PM
>To: 'Tomcat Users List'
>Subject: RE: URL validation
>
>Hi Steffen,
>
>Thanks, new URL(url) doesn't work consistently.  I have tried it,
>one can throw in an url that doesn't meet RFC 1738 but URL(url) will
>not catch it.
>
>Thanks,
>
>Ike
>
>
>-Original Message-
>From: SH Solutions [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 08, 2004 12:30 PM
>To: 'Tomcat Users List'
>Subject: RE: URL validation
>
>
>Hi
>
>> Here is my problem, I am looking for a way to syntactically valid a
given
>URL without having to actually creating an URL object.
>
>try {
>  new URL( myUrl );
>  return true;
>} catch ( Throwable t ) {
>  return false;
>}
>
>Why not creating it?
>Javas young generation garbage collection should dispose this
immediatly.
>So
>problem here.
>
>Regards,
>  Steffen
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: URL validation

2004-06-08 Thread Ikonne, Ike
Hi,

No, I have not.  I haven't thought about it.

Ike


-Original Message-
From: Vy Ho [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 08, 2004 2:22 PM
To: Tomcat Users List
Subject: Re: URL validation


Did you file a bug report at java.sun.com yet?


Ikonne, Ike wrote:

>Hi Steffen,
>
>Thanks, new URL(url) doesn't work consistently.  I have tried it, 
>one can throw in an url that doesn't meet RFC 1738 but URL(url) will
>not catch it.
>
>Thanks,
>
>Ike
>  
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL validation

2004-06-08 Thread Vy Ho
Did you file a bug report at java.sun.com yet?
Ikonne, Ike wrote:
Hi Steffen,
Thanks, new URL(url) doesn't work consistently.  I have tried it, 
one can throw in an url that doesn't meet RFC 1738 but URL(url) will
not catch it.

Thanks,
Ike
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: URL validation

2004-06-08 Thread Ikonne, Ike
Hi James,

Thanks, I will try your suggestion and let you know if it
meets my requirements.

Ike


-Original Message-
From: James Black [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 08, 2004 2:06 PM
To: Tomcat Users List
Subject: Re: URL validation


Ikonne, Ike wrote:

>Hi Steffen,
>
>Thanks, new URL(url) doesn't work consistently.  I have tried it, 
>one can throw in an url that doesn't meet RFC 1738 but URL(url) will
>not catch it.
>  
>
You could try regular expressions.

Here is a relatively simple one:
(?:ftp\:|http\:|mailto\:)?(\w+\@)?(www\.)?\w+(\.\w+)+(\:\d+)?

-- 
"Love is mutual self-giving that ends in self-recovery." Fulton Sheen
James Black[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: URL validation

2004-06-08 Thread James Black
Ikonne, Ike wrote:
Hi Steffen,
Thanks, new URL(url) doesn't work consistently.  I have tried it, 
one can throw in an url that doesn't meet RFC 1738 but URL(url) will
not catch it.
 

You could try regular expressions.
Here is a relatively simple one:
(?:ftp\:|http\:|mailto\:)?(\w+\@)?(www\.)?\w+(\.\w+)+(\:\d+)?
--
"Love is mutual self-giving that ends in self-recovery." Fulton Sheen
James Black[EMAIL PROTECTED]


RE: URL validation

2004-06-08 Thread Ikonne, Ike
Hi Steffen,

Thanks, new URL(url) doesn't work consistently.  I have tried it, 
one can throw in an url that doesn't meet RFC 1738 but URL(url) will
not catch it.

Thanks,

Ike


-Original Message-
From: SH Solutions [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 08, 2004 12:30 PM
To: 'Tomcat Users List'
Subject: RE: URL validation


Hi

> Here is my problem, I am looking for a way to syntactically valid a given
URL without having to actually creating an URL object.

try {
  new URL( myUrl );
  return true;
} catch ( Throwable t ) {
  return false;
}

Why not creating it?
Javas young generation garbage collection should dispose this immediatly. So
problem here.

Regards,
  Steffen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: URL validation

2004-06-08 Thread SH Solutions
Hi

> ... So problem here.

Meant: No problem here.

Sorry, regards,
  Steffen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: URL validation

2004-06-08 Thread SH Solutions
Hi

> Here is my problem, I am looking for a way to syntactically valid a given
URL without having to actually creating an URL object.

try {
  new URL( myUrl );
  return true;
} catch ( Throwable t ) {
  return false;
}

Why not creating it?
Javas young generation garbage collection should dispose this immediatly. So
problem here.

Regards,
  Steffen


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



URL validation

2004-06-08 Thread Ikonne, Ike

Hi all,

I don't know if this is the right forum to posse this question,
but I will go ahead and give it a try.

Here is my problem, I am looking for a way to syntactically valid
a given URL without having to actually creating an URL object.

Is there a piece of code out there that would enable me to do this 
based on RFC 1738?  Any hints will be appreciated.


Cheers,

Ike



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]