You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Saurabh Shukla <sa...@cysphere.com> on 2000/12/19 04:48:26 UTC
RE: checking remore URL
What are you using ? Iifapache then it is pretty easy.
Regards,
Shuklix
-----Original Message-----
From: zk@t-online.de [mailto:zk@t-online.de]On Behalf Of Zsolt Koppany
Sent: Tuesday, December 19, 2000 9:02 PM
To: tomcat-user@jakarta.apache.org
Subject: checking remore URL
Hi,
how can I check whether an URL exists?
For example if the http://www.xy.com/welcome_de.html does not exist I
would like to take http://www.xy.com/welcome_en.html.
--
Zsolt Koppany
Intland GmbH www.intland.com
Schulze-Delitzsch-Strasse 16
D-70565 Stuttgart
Tel: +49-711-7871080 Fax: +49-711-7871017
Re: checking remore URL
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Zsolt Koppany wrote:
> Thank you for the idea Craig but java.net.URLConnection is an abstract
> class, how can I do that?
URL url = new URL("http://www.yahoo.com");
URLConnection conn = url.openConnection();
There are more comprehensive examples in the Java Language Tutorial's networking
trail, at <http://java.sun.com/docs/books/tutorial>.
>
> Zsolt
>
Craig
Re: checking remore URL
Posted by Zsolt Koppany <zk...@intland.com>.
Thank you for the idea Craig but java.net.URLConnection is an abstract
class, how can I do that?
Zsolt
"Craig R. McClanahan" wrote:
>
> Zsolt Koppany wrote:
>
> > I use tomcat but I think it must be done over the http protocol?
> >
>
> Check out the java.net.URLConnection class, which lets you connect to remote
> servers. If you try to access a non-existent page, you will get a
> java.io.FileNotFoundException back.
>
> >
> > Zsolt
> >
>
> Craig McClanahan
--
Zsolt Koppany
Intland GmbH www.intland.com
Schulze-Delitzsch-Strasse 16
D-70565 Stuttgart
Tel: +49-711-7871080 Fax: +49-711-7871017
Re: checking remore URL
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Zsolt Koppany wrote:
> I use tomcat but I think it must be done over the http protocol?
>
Check out the java.net.URLConnection class, which lets you connect to remote
servers. If you try to access a non-existent page, you will get a
java.io.FileNotFoundException back.
>
> Zsolt
>
Craig McClanahan
Re: checking remore URL
Posted by Zsolt Koppany <zk...@intland.com>.
I use tomcat but I think it must be done over the http protocol?
Zsolt
Saurabh Shukla wrote:
>
> What are you using ? Iifapache then it is pretty easy.
>
> Regards,
> Shuklix
>
> -----Original Message-----
> From: zk@t-online.de [mailto:zk@t-online.de]On Behalf Of Zsolt Koppany
> Sent: Tuesday, December 19, 2000 9:02 PM
> To: tomcat-user@jakarta.apache.org
> Subject: checking remore URL
>
> Hi,
>
> how can I check whether an URL exists?
>
> For example if the http://www.xy.com/welcome_de.html does not exist I
> would like to take http://www.xy.com/welcome_en.html.
>
> --
> Zsolt Koppany
> Intland GmbH www.intland.com
> Schulze-Delitzsch-Strasse 16
> D-70565 Stuttgart
> Tel: +49-711-7871080 Fax: +49-711-7871017
--
Zsolt Koppany
Intland GmbH www.intland.com
Schulze-Delitzsch-Strasse 16
D-70565 Stuttgart
Tel: +49-711-7871080 Fax: +49-711-7871017