Netwars

Java Desktop Application

[#1]
07.06.2008 01:04

Co to za blad:
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 401 for URL: http://p1.idg.pl/rss/program_tv.php?kanal=CPL
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1170)

Dodam tylko, ze w zwyklym java Aplication smiga bezblednie ;/

[#2]
07.06.2008 01:05

znacie jakies fajbe tutoriale do Java Desktop Application w NetBeans'ie?

[#3]
07.06.2008 01:06

sypie sie w tym fragmencie:
public boolean getSiteContent() throws MalformedURLException, IOException
{
URL url = new URL( address );
HttpURLConnection connection = ( HttpURLConnection ) url.openConnection();

//ponizej sie wysypuje, pod zmienna address jest: //http://p1.idg.pl/rss/program_tv.php?kanal=CPL

BufferedReader input = new BufferedReader(
new InputStreamReader( connection.getInputStream() ) );
String inputLine;
StringBuffer buffer= new StringBuffer();
while ( ( inputLine = input.readLine() ) != null ) { buffer.append( inputLine ); }
String content = buffer.toString();

Zaloguj się, żeby odpowiedzieć.