When you say it's not working, what isn't working?

Can you see the post on the wire? Is the JSP getting called? Is the data
getting through? Can you POST to the JSP from telnet? from an HTML form?

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Phil Swenson
> Sent: 26 May 2000 03:11
> To: [EMAIL PROTECTED]
> Subject: POSTing to a JSP from a Java class - Getting desperate!
>
>
> This is actually close to being OT, but I think many are interested in how
> to do this.
>
> I'm trying to post to a JSP from a Java class.  I absolutely can't get the
> thing to work.  The post is always completely empty.  Here is my code:
>
>       URL url = new URL("http://www.blah.com/blah.jsp");
>       URLConnection connection = url.openConnection();
>       ((HttpURLConnection)connection).setRequestMethod("POST");
> (yes, I know the setRequestMethod is probably unnecessary)
>       connection.setDoInput (true);
>       connection.setDoOutput(true);
>       connection.setUseCaches(false);
>       connection.setRequestProperty( "content-type",
> "application/x-www-form-urlencoded" );
>       PrintStream outStream = new
> PrintStream( connection.getOutputStream() );
>       String blah = "hey=there";
>       outStream.println(blah);
>       outStream.flush ();
>       outStream.close();
>
> I've hit JavaSoft message boards and tried everything that was posted...it
> just doesn't work.
>
> Please help if you have any solutions.
>
> phil
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to