.dsy:it. Pages (10): « First ... « 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)


Posted by supernova on 12-12-2005 14:14:

Si così, come dice il pdf. 2 domanducce ho :

1) // Set up input stream filters.
//?

quel ? che ci devo mettere?

2) String requestLine = ?
io gli passo request, giusto o faccio una cazzata?

Aiutemi perchè domani si avvicina!

__________________
" So I Start The Revolution From My Bed ". Noel Gallagher


Posted by pinauz on 12-12-2005 14:16:

x la pima non lo so per la seconda c'è scritto sul testo...
ti dice che ilmetodo readLine() della calsee Bufferedreader di da la String requestLine

__________________
movimento ultras contro diffide e repressione


Posted by supernova on 12-12-2005 14:22:

br.readLine() quindi devo usare? Mi rimane solo quel maledetto errore di HttpRequest. Sempre che br.readLine() sia giusto da usare.
Oppure mi devo creare un readLine negli stream di input?

__________________
" So I Start The Revolution From My Bed ". Noel Gallagher


Posted by pinauz on 12-12-2005 14:23:

bravo!! io invece nn ho capito che vuole nella statusLine e nel contentTypeLine


Posted by [>>>>VK<<<<] on 12-12-2005 14:24:

Mattex185 puoi dirmi se lo strutturato in modo giusto? allora:

mport java.io.* ;
import java.net.* ;
import java.util.* ;

public final class WebServer{

public static void main(String argv[]) throws Exception{
......
}

}

final class HttpRequest implements Runnable {

public HttpRequest(Socket socket) throws Exception {
}
public void run(){
}
private void processRequest() throws Exception {
E' IN QUESTA CLASSE CHE VA TUTTO IL PROCESSO PER VERIFICARE SE IL FILE VIENE TROVATO E ANALIZZATO ???
}
private static void sendBytes(FileInputStream fis, OutputStream os)throws Exception {
PER INVIARE I FILE AL CLIENT
}
private static String contentType(String fileName){
IDENTIFICAZIONE DEL TIPO DI FILE.
}
}

__________________
Jessica Alba Italian Fans Site


Posted by Mattex185 on 12-12-2005 14:31:

penso sia giusto
ma nn voglio prendermi NESSUNA responsabilità :)


Posted by [>>>>VK<<<<] on 12-12-2005 14:34:

Originally posted by Mattex185
penso sia giusto
ma nn voglio prendermi NESSUNA responsabilità :)


thx

__________________
Jessica Alba Italian Fans Site


Posted by EmoGuy on 12-12-2005 14:40:

Quindi nella final class ..... implements runnable vanno messe tutte le altre? Non riesco a capire a che livello si inseriscono le varie parti ....
Lo sviluppo final static String CRFL va messo pria o dopo
public HttpRequest(Socket socket) throws Exception {
}


Posted by Mattex185 on 12-12-2005 14:48:

Originally posted by EmoGuy
Quindi nella final class ..... implements runnable vanno messe tutte le altre? Non riesco a capire a che livello si inseriscono le varie parti ....

si va tutto dentro quella classe
le parti inseriscile una dopo l'altra e dovresti farcela
Originally posted by EmoGuy
Lo sviluppo final static String CRFL va messo pria o dopo
public HttpRequest(Socket socket) throws Exception {
} [/B]

essendo la creazione di una variabile, va creata dentro la classe,ovvero dopo public HttpRequest(Socket socket) throws Exception {
}

ora vi saluto che devo uscire.
buon lavoro ^^


Posted by EmoGuy on 12-12-2005 14:59:

Ma è qualcosa del genere ?


final class HttpRequest implements Runnable {

final static String CFRL = .....
.......
.......
if ( fileExists)......

public HttpRequest(Socket socket) throws Exception {
}

public void run(){
}


Posted by [>>>>VK<<<<] on 12-12-2005 15:10:

Originally posted by EmoGuy
Quindi nella final class ..... implements runnable vanno messe tutte le altre? Non riesco a capire a che livello si inseriscono le varie parti ....
Lo sviluppo final static String CRFL va messo pria o dopo
public HttpRequest(Socket socket) throws Exception {
}


abbiamo lo stesso problema anche io nn capisco che devo fare qui:

There are three parts to the response message: the status line, the response headers, and the entity body.
The status line and response headers are terminated by the character sequence CRLF. We are going to
respond with a status line, which we store in the variable statusLine, and a single response header, which
we store in the variable contentTypeLine. In the case of a request for a nonexistent file, we return 404 Not
Found in the status line of the response message, and include an error message in the form of an HTML
document in the entity body.


// Construct the response message.
String statusLine = null;
String contentTypeLine = null;
String entityBody = null;
if (fileExists) {
statusLine = ?;
contentTypeLine = "Content-type: " +
contentType( fileName ) + CRLF;
} else {
statusLine = ?;
contentTypeLine = ?;
entityBody = "<HTML>" +
"<HEAD><TITLE>Not Found</TITLE></HEAD>" +
"<BODY>Not Found</BODY></HTML>";
}

__________________
Jessica Alba Italian Fans Site


Posted by pinauz on 12-12-2005 15:11:

allora... io nella status line ho messo uno stringa che dice se il file esiste oppure no, la contenttype invece è gia scritta


Posted by [>>>>VK<<<<] on 12-12-2005 15:15:

Originally posted by pinauz
allora... io nella status line ho messo uno stringa che dice se il file esiste oppure no, la contenttype invece è gia scritta



in che senso cosi: statusLine = fis.toString()

__________________
Jessica Alba Italian Fans Site


Posted by pinauz on 12-12-2005 15:16:

no no del tipo "file esistente"


Posted by EmoGuy on 12-12-2005 15:18:

L' ordine è quello che hai messo tu prima:

Main
HttpRequest implements runnable che contiene tutto il resto

quello che io continuo a non capire a parte qualche errore sparso qui e li è dove va tutto il malloppazzo di roba che inizia con


Final static String CRFL ....
....
...
...
If(fileExists).... [il pezzo dove c'è la tag html fino all'ì if dell ' entity body ]


Ma a te

String statusLine = null;
if (fileExists)

non danno errore ?




Sto per diventare pessimista....


All times are GMT. The time now is 04:38. Pages (10): « First ... « 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.