 |
supernova |
Si così, come dice il pdf. 2 domanducce ho :
... |
12-12-2005 14:14 |
|
 |
supernova |
Mad For It

Registered: May 2003
Posts: 403 (0.05 al dì)
Location: Milan, London
Corso: Digital Comunication
Anno: I Don't Know, Not Yet.
Time Online: 3 Days, 4:56:55 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
12-12-2005 14:14 |
|
|
|  |
 |
pinauz |
x la pima non lo so per la seconda c'è scritto su ... |
12-12-2005 14:16 |
|
 |
pinauz |
.grande:maestro.
Registered: Nov 2004
Posts: 734 (0.10 al dì)
Location: a casa mai
Corso: NO: la nostra risposta al vostro calcio
Anno: !!!!!!!
Time Online: 3 Days, 17:43:10 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
12-12-2005 14:16 |
|
|
|  |
 |
supernova |
br.readLine() quindi devo usare? Mi rimane solo qu ... |
12-12-2005 14:22 |
|
 |
supernova |
Mad For It

Registered: May 2003
Posts: 403 (0.05 al dì)
Location: Milan, London
Corso: Digital Comunication
Anno: I Don't Know, Not Yet.
Time Online: 3 Days, 4:56:55 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
12-12-2005 14:22 |
|
|
|  |
 |
pinauz |
bravo!! io invece nn ho capito che vuole nella sta ... |
12-12-2005 14:23 |
|
 |
pinauz |
.grande:maestro.
Registered: Nov 2004
Posts: 734 (0.10 al dì)
Location: a casa mai
Corso: NO: la nostra risposta al vostro calcio
Anno: !!!!!!!
Time Online: 3 Days, 17:43:10 [...]
Status: Offline
Edit | Report | IP: Logged |
bravo!! io invece nn ho capito che vuole nella statusLine e nel contentTypeLine
|
12-12-2005 14:23 |
|
|
|  |
 |
[>>>>VK<<<<] |
Mattex185 puoi dirmi se lo strutturato in modo giu ... |
12-12-2005 14:24 |
|
 |
[>>>>VK<<<<] |
.arcimaestro.

Registered: Jan 2005
Posts: 347 (0.05 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 22:11:49 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
12-12-2005 14:24 |
|
|
|  |
 |
Mattex185 |
penso sia giusto
... |
12-12-2005 14:31 |
|
 |
Mattex185 |
.grande:maestro.

Registered: Sep 2004
Posts: 520 (0.07 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: Laureato
Time Online: 11 Days, 3:18:23 [...]
Status: Offline
Edit | Report | IP: Logged |
penso sia giusto
ma nn voglio prendermi NESSUNA responsabilità 
|
12-12-2005 14:31 |
|
|
|  |
 |
[>>>>VK<<<<] |
[QUOTE][i]Originally posted by Mattex185 [/i]
... |
12-12-2005 14:34 |
|
 |
[>>>>VK<<<<] |
.arcimaestro.

Registered: Jan 2005
Posts: 347 (0.05 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 22:11:49 [...]
Status: Offline
Edit | Report | IP: Logged |
Originally posted by Mattex185
penso sia giusto
ma nn voglio prendermi NESSUNA responsabilità
thx
__________________
Jessica Alba Italian Fans Site
|
12-12-2005 14:34 |
|
|
|  |
 |
EmoGuy |
Quindi nella final class ..... implements runnabl ... |
12-12-2005 14:40 |
|
 |
EmoGuy |
.simpatizzante.

Registered: Oct 2005
Posts: 11 (0.00 al dì)
Location: Garbagnate Milanese
Corso: Comunicazione digitale
Anno: Terzo
Time Online: 5:47:12 [...]
Status: Offline
Edit | Report | IP: Logged |
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 {
}
|
12-12-2005 14:40 |
|
|
|  |
 |
Mattex185 |
[QUOTE][i]Originally posted by EmoGuy [/i]
... |
12-12-2005 14:48 |
|
 |
Mattex185 |
.grande:maestro.

Registered: Sep 2004
Posts: 520 (0.07 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: Laureato
Time Online: 11 Days, 3:18:23 [...]
Status: Offline
Edit | Report | IP: Logged |
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 ^^
|
12-12-2005 14:48 |
|
|
|  |
 |
EmoGuy |
Ma è qualcosa del genere ?
... |
12-12-2005 14:59 |
|
 |
EmoGuy |
.simpatizzante.

Registered: Oct 2005
Posts: 11 (0.00 al dì)
Location: Garbagnate Milanese
Corso: Comunicazione digitale
Anno: Terzo
Time Online: 5:47:12 [...]
Status: Offline
Edit | Report | IP: Logged |
Ma è qualcosa del genere ?
final class HttpRequest implements Runnable {
final static String CFRL = .....
.......
.......
if ( fileExists)......
public HttpRequest(Socket socket) throws Exception {
}
public void run(){
}
|
12-12-2005 14:59 |
|
|
|  |
 |
[>>>>VK<<<<] |
[QUOTE][i]Originally posted by EmoGuy [/i]
... |
12-12-2005 15:10 |
|
 |
[>>>>VK<<<<] |
.arcimaestro.

Registered: Jan 2005
Posts: 347 (0.05 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 22:11:49 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
12-12-2005 15:10 |
|
|
|  |
 |
pinauz |
allora... io nella status line ho messo uno string ... |
12-12-2005 15:11 |
|
 |
pinauz |
.grande:maestro.
Registered: Nov 2004
Posts: 734 (0.10 al dì)
Location: a casa mai
Corso: NO: la nostra risposta al vostro calcio
Anno: !!!!!!!
Time Online: 3 Days, 17:43:10 [...]
Status: Offline
Edit | Report | IP: Logged |
allora... io nella status line ho messo uno stringa che dice se il file esiste oppure no, la contenttype invece è gia scritta
|
12-12-2005 15:11 |
|
|
|  |
 |
[>>>>VK<<<<] |
[QUOTE][i]Originally posted by pinauz [/i]
... |
12-12-2005 15:15 |
|
 |
[>>>>VK<<<<] |
.arcimaestro.

Registered: Jan 2005
Posts: 347 (0.05 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 22:11:49 [...]
Status: Offline
Edit | Report | IP: Logged |
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
|
12-12-2005 15:15 |
|
|
|  |
 |
pinauz |
no no del tipo "file esistente" ... |
12-12-2005 15:16 |
|
 |
pinauz |
.grande:maestro.
Registered: Nov 2004
Posts: 734 (0.10 al dì)
Location: a casa mai
Corso: NO: la nostra risposta al vostro calcio
Anno: !!!!!!!
Time Online: 3 Days, 17:43:10 [...]
Status: Offline
Edit | Report | IP: Logged |
no no del tipo "file esistente"
|
12-12-2005 15:16 |
|
|
|  |
 |
EmoGuy |
L' ordine è quello che hai messo tu prima:
... |
12-12-2005 15:18 |
|
 |
EmoGuy |
.simpatizzante.

Registered: Oct 2005
Posts: 11 (0.00 al dì)
Location: Garbagnate Milanese
Corso: Comunicazione digitale
Anno: Terzo
Time Online: 5:47:12 [...]
Status: Offline
Edit | Report | IP: Logged |
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....
|
12-12-2005 15:18 |
|
|
|  |
 |
All times are GMT. The time now is 20:24. |
|
|
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|