hmm.. I did that. But not like a file...not like a stream... just a text in
POST parameter.
pipeline:
<map:match pattern="upload/myxsp">
        <map:generate src="upload/myxsp.xsp" type="serverpages"/>
        <map:serialize type="xml"/>
</map:match>

-----
for test myxsp.html:
<html>
  <body>
    <form action="http://localhost:80/upload/myxsp"; method="post"
enctype="multipart/form-data">
      File:  <input type="text" name="uploadfile">
      <input type="submit"/>
  </body>
</html>
-----
as example... myxsp.xsp:
<?xml version="1.0"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp";>
<root>
<xsp:logic>
try {
String foo = request.getParameter("uploadfile");
System.out.println(foo);
javax.xml.parsers.DocumentBuilderFactory factory =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
javax.xml.parsers.DocumentBuilder builder = factory.newDocumentBuilder();
org.w3c.dom.Document doc = builder.parse(new
java.io.ByteArrayInputStream(foo.getBytes()));
org.w3c.dom.NodeList catlist =
doc.getDocumentElement().getElementsByTagName("category");
for (int i = 0; i &lt; catlist.getLength(); i++)
{
        org.w3c.dom.Node boo = catlist.item(i); 
        <xsp:content>
                <xsp:expr>boo</xsp:expr> 
        </xsp:content>
} 
}catch(java.lang.Exception e) 
        {
                System.out.print(e.toString());
        }
</xsp:logic>
</root>
</xsp:page>
-------------
but.......but I don't need to put xml to parameter.
I need to take a Content of request. But cocoon's HttpRequest hasn't
.getContent(). There is getInputStream, but I can't to understand how to use
that.
-- 
View this message in context: 
http://www.nabble.com/POST-.xml-tp15517307p15561431.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to