![]() |
Pages (10): « First ... « 4 5 6 7 [8] 9 10 » Show 150 posts per page |
.dsy:it. (http://www.dsy.it/forum/)
- Reti di calcolatori (http://www.dsy.it/forum/forumdisplay.php?forumid=68)
-- [comdig-prini]WebSever (http://www.dsy.it/forum/showthread.php?threadid=23043)
Originally posted by EmoGuy.
Errori in comprensibili ....
Parte B dove dice //Construct the response message :
String statusLine = null; dice " identifier expected "
L' if subito sotto :
if ( fileExists) " illegal start of type "
os.writeBytes(statusLine); "identifier expected "
Inizio a dare segni di squilibrio ....
scusa mettx ma nella classe inputstream devi fare riferimento alla connection di socket della classe webserver...come hai fatto?
a volte mi accorgo di dire una cifra di c****te! cmq la prima parte sembra funzionare ancora nn ci credo!
mi ridà questa stringa...
GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
java.io.IOException: Stream closed
perchè mi chiude la connessione?
nn so se ho capito il punto ma cmq ho fatto "semplicemente"
socket.getInputStream()
x la risposta del prompt nn so dirti
Io no, ma forse ho sbagliato a completare, l' ho scritta semplice semplice come si è visto a laboratorio; alla stessa maniera DataOutputStream e bufferedReader;
A me da errore su tokens.nextToken(); dicendo che " identifier expected " e su fileName = "." + fileName; il motivo è sempre " identifier expected "
scusa...ma inputstream is= ?
come lo inizializzi?
ioho fatto new inputstream bla bla bla ma mi dice che è un aclasse astratta e nn lo posso fare
nell'inputstream nn ho fatto new io
solo
InputStream is = socket.getInputStream();
mattex quasi ti amo!!!
cmq continua a darmi sta roba
GET /prova.htm HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
java.io.IOException: Stream closed
Finished executing
nn mi ricordo davvero se sia la risposta giusta...tu vai avanti e poi vedi intanto provo a rivedere se mi da quello ma nn so se ci riesco
public final class WebServer {
public static void main(String argv[]) throws Exception
{
// Set the port number.
int port = 6789;
// Establish the listen socket.
ServerSocket s = new ServerSocket(port);
// Process HTTP service requests in an infinite loop.
while (true) {
// Listen for a TCP connection request.
Socket w = s.accept();
// Construct an object to process the HTTP request message.
HttpRequest request = new HttpRequest(w);
// Create a new thread to process the request.
Thread thread = new Thread(request);
// Start the thread.
thread.start();
}
}
Ora mi dite per piacere perchè mi da errore di compilazione nel metodo HttpRequest? A me sembra tutto ok!
__________________
" So I Start The Revolution From My Bed ". Noel Gallagher
guarda che non puoi scrivere codice o parte di codice di un elaborato....! cmq posta l'errore che ti da!
domanda: la parte b implementa l meodo run di httprequest?
Pinauz questa parte mi sembra che si stata implementata da tutti quindi non vedo problemi a postarla. Cmq scusate ma è da venerdi che sto sclerando con sto errore: WebServer.java:20: non-static variable this cannot be referenced from a static context
HttpRequest request = new HttpRequest(w);
Di grazia cos'è che non va?
__________________
" So I Start The Revolution From My Bed ". Noel Gallagher
la classe http request come l'hai dichiarata? final static public....
come da pdf.
__________________
" So I Start The Revolution From My Bed ". Noel Gallagher
final class HttpRequest implements Runnable? boh...a me nn da errore
__________________
movimento ultras contro diffide e repressione
All times are GMT. The time now is 01:27. | Pages (10): « First ... « 4 5 6 7 [8] 9 10 » Show all 148 posts from this thread on one page |
Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.