URL normalization

C

Chris

A

Andrew Thompson

Does anyone know of code to normalize a URL? We're processing a lot of URLs,
and we get a lot of bad ones:

Why, where do they originate?

It is probably better strategy to put
editing and checking of URL's at the
input stage, if you can, so you never get
these bad URL's.

So does this exist?
http://mydomain.com/anotherdir/

URL's, AFAIR, will resolve that correctly
if it actually poinsts somewhere that exists.
(And if it does not, how do you determine what
the user actually meant?)

The last one can be solved by using
URLEncoder.encode()
I'm sure there's a lot of stuff out there that I haven't seen yet, either.
I'm wondering if anyone has already written a class that will clean this
stuff up.

It sounds like it needs to have DWIMNWIS
functionality, or implement the Psychic
interface. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top