Hi Paul

Not saying this will work, and I haven't tried it on a JSP
page, but I know it works with applet-servlet communications.
Try sending via a POST method:

1.  set up your connection:
    URL url = new URL("https://www.dunno.com/cgi-bin/abc.cgi?Transact");
    URLConnection c = url.openConnection();

2.  Set up your HTTP headers (might have to play with this):

    c.setRequestProperty("Accept", "text/*");
    c.setRequestProperty("User-Agent", "XML Test App");
    c.setRequestProperty("Content-Type", "text/XML")
    c.setDoOutput(true);
    c.setDoInput(true);

3.  Format your stuff:
    String xml_trans = "<?xml version="1.0" encoding="UTF-8"?> <myApp
objectCount="2" this="0" that="0">;

4.  Ship it:
    PrintWriter out = new PrintWriter(c.getOutputStream());
    out.println(xml_trans);


Your receiving page will have to set up a "BufferedReader:"

   BufferedReader in = new BufferedReader(
        new InputStreamReader(
        c.getInputStream()));

   while ((inputLine = in.readLine()) != null)
        System.out.println(inputLine);


Hope this helps...

Kevin Carothers


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Paul Beer
Sent: Wednesday, February 23, 2000 3:03 PM
To: [EMAIL PROTECTED]
Subject: passing xml


i am using URLEncoder.encode(xmlPacket) in a hidden form field to pass xml
from one page to the next.  I get malformed errors all the time... could
someone suggest a better way to use jsp to send xml packets to another jsp
page, either through jsp:forward or via html form posting .....

thanks,
paul

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to