Hi,
I have a jsp/html web page with a form inside. Now, i would like to
transform
my jsp page into an applet. I try but i don't know how to pass parameters
(of POST) to the servlet ...
Here is my little code :
HttpURLConnection con = (HttpURLConnection) servlet.openConnection();
// Prepare for both input and output
con.setDoInput(true);
con.setDoOutput(true);
// Turn off caching
con.setUseCaches(false);
con.setDefaultUseCaches(false);
con.setAllowUserInteraction(true);
// Set the content type to be application/x-java-serialized-object
con.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
con.setRequestMethod("POST");
ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
out.writeBytes("param1=string1¶m2=string2");
out.flush();
out.close();
But with request.getParameter("param1") i receive null.
Thanks
Seb
___________________________________________________________________________
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