i just found
the doPost need HttpServletResponse and HttpServletRequest

i didn't think that my flow had something to do with it


thanks Rob for your suggestion

Regards
Saroumane
HERS College
Belgium

-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de
saroumane
Envoy� : lundi 7 mai 2001 14:51
� : [EMAIL PROTECTED]
Objet : Re: HTTP tunneling


i just see that in Marty's book, he opens an InputStream over the
connection, things that i didn't do

i made it, and now the connection works
the return goes to a TextArea that i put in the applet (like Marty do)
but i want my servlet to return an html page
what can i do
when i don't open this inputstream, it doesn't work at all ..

could someone explain me this behavior
i don't understand

saroumane
HERS College
Belgium

-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de Rob
Griffin
Envoy� : lundi 7 mai 2001 05:14
� : [EMAIL PROTECTED]
Objet : Re: HTTP tunneling


Saroumane,

Try the additional line of code below. For some reason
you have to force the connection sometimes.

Hope this helps,

Rob Griffin
Quest Software

E-mail: [EMAIL PROTECTED]
Web site: http://www.quest.com

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> saroumane
> Sent: Monday, 7 May 2001 12:07 PM
> To: [EMAIL PROTECTED]
> Subject: HTTP tunneling
>
>
> hi everybody
> i'm having a problem to use http tunneling between applet and
> servlet (using
> apache 1.3.19 + JServ 1.2.2)
> i adapt  my code from marty's book core servlets but didn't work
> at all for
> me
> i search solutions here but ...
> found some sites but they do the same than marty .. and of course
> i did too
>
> here some part of it
>
> ##################################################################
> ##########
> #####
> URL urlServlet = new
> URL("http://private.wildness.loc/servlet/MysqlServlet";);
> URLConnection connection = urlServlet.openConnection();
> connection.setDoOutput(true);
> connection.setUseCaches(false);
> connection.setDefaultUseCaches(false);

  connection.connect();  // <<<<<<<<<<<<<<<<<<<<<<<<< add this

>
> ByteArrayOutputStream byteStream = new ByteArrayOutputStream(1024);
> PrintWriter out = new PrintWriter(byteStream,true);
>
> String data = "nom=" + URLEncoder.encode(nom)+ "&prenom=" +
> URLEncoder.encode(prenom)
>                + "&localite=" + URLEncoder.encode(localite)
>                + "&sexe=" + URLEncoder.encode(sexe)
>                + "&adresse=" + URLEncoder.encode(adresse)
>                + "&numero=" + URLEncoder.encode(numero)
>                + "&codepostal=" + URLEncoder.encode(codepostal);
>
> out.print(data);
> out.flush();
> connection.setRequestProperty("Content-Length",
> String.valueOf(byteStream.size()));
> connection.setRequestProperty("Content-Type",
> "application/x-www-form-urlencoded");
>
> byteStream.writeTo(connection.getOutputStream());
> byteStream.close();
> ##################################################################
> ##########
> ############
>
> it doens'nt reach my server no trace in jserv.log or in mod_jserv.log
> there's no init method calling
> i try the url directly in the browser and it works...
>
> any idea ???
>
>
> saroumane
> HERS College
> Belgium
>
>
>
>
> __________________________________________________________________
> ____________
> ifrance.com, l'email gratuit le plus complet de l'Internet !
> vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
> http://www.ifrance.com/_reloc/email.emailif
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


____________________________________________________________________________
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to