You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Flutina.Zhu" <fl...@gmail.com> on 2007/09/13 12:19:06 UTC

How to use stream generator to get multipart/form-data POST value

hi, all

I met a problem with stream generator.

I submit a form as

<form id="uploadForm" dojoAttachPoint="uploadFormNode" method="post"
enctype="multipart/form-data" action="upload.xml">
   ...
   <input name="target" id="target" name="target" type="file"/>
   ...
</form>

So in the sitemap it as follow:

      <map:generate type="stream">
          <map:parameter name="form-name" value="target"/>
          <map:parameter name="defaultContentType"
value="multipart/form-data"/>
        </map:generate>

but I get the error like :

Exception in StreamGenerator.generate(): java.lang.NullPointerException



So what's wrong with my code? the "target" is a well-format xml file.

Anybody can help me?



-flutina

Re: How to use stream generator to get multipart/form-data POST value

Posted by "Flutina.Zhu" <fl...@gmail.com>.
BTW, I am using cocoon 2.1.4 with Jetty-5-1-6 and firefox

Re: How to use stream generator to get multipart/form-data POST value

Posted by Joerg Heinicke <jo...@gmx.de>.
On 18.09.2007 4:32 Uhr, Flutina.Zhu wrote:

> I found the reason. This is a bug for cocoon2.1.4, request parameter with
> multipart/form-data
> 
> See
> 
> http://209.85.135.104/search?q=cache:a9GbS6rjuMsJ:cocoon.apache.org/2.1/changes.html+cocoon+changelist&hl=en&ct=clnk&cd=1
> 
> Allow streaming of uploaded files into a pipeline using StreamGenerator.
> Committed by JH. Thanks to Gernot Koller <grizzly.at.gmx.at>. See Issue
> 25594 <http://issues.apache.org/jira/browse/25594>.

The corrected link to the issue is 
https://issues.apache.org/jira/browse/COCOON-988.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How to use stream generator to get multipart/form-data POST value

Posted by "Flutina.Zhu" <fl...@gmail.com>.
Hi, Thank you guys.

I found the reason. This is a bug for cocoon2.1.4, request parameter with
multipart/form-data

See

http://209.85.135.104/search?q=cache:a9GbS6rjuMsJ:cocoon.apache.org/2.1/changes.html+cocoon+changelist&hl=en&ct=clnk&cd=1

Allow streaming of uploaded files into a pipeline using StreamGenerator.
Committed by JH. Thanks to Gernot Koller <grizzly.at.gmx.at>. See Issue
25594 <http://issues.apache.org/jira/browse/25594>.

Thanks

Re: How to use stream generator to get multipart/form-data POST value

Posted by Joerg Heinicke <jo...@gmx.de>.
On 13.09.2007 6:19 Uhr, Flutina.Zhu wrote:

> Exception in StreamGenerator.generate(): java.lang.NullPointerException

Can you please post the meaningful parts of the stacktrace?

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: How to use stream generator to get multipart/form-data POST value

Posted by Geert Josten <ge...@daidalos.nl>.
As an alternative, you could prefix the target field name with 'xml:'
and use the request generator.

If you don't specify parameters on the stream generator, it tries to
process the request body. But how to get XML in the body with a html
submit form?

HTH,
Geert

> 
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
 

> From: Flutina.Zhu [mailto:flutina@gmail.com] 
> Sent: donderdag 13 september 2007 12:19
> To: users@cocoon.apache.org
> Subject: How to use stream generator to get 
> multipart/form-data POST value
> 
> hi, all
>  
> I met a problem with stream generator.
>  
> I submit a form as
>  
> <form id="uploadForm" dojoAttachPoint="uploadFormNode" 
> method="post" enctype="multipart/form-data" action="upload.xml">
>    ...
>    <input name="target" id="target" name="target" type="file"/>
>    ...
> </form>
>  
> So in the sitemap it as follow:
>  
>       <map:generate type="stream">
>           <map:parameter name="form-name" value="target"/>
>           <map:parameter name="defaultContentType" 
> value="multipart/form-data"/> 
>         </map:generate>
>  
> but I get the error like : 
> Exception in StreamGenerator.generate(): 
> java.lang.NullPointerException
>  
> So what's wrong with my code? the "target" is a well-format xml file.
> Anybody can help me?
>  
> -flutina
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org