Hi,
I was wrong. With a fresh cocoon-2.1.9 installation on Tomcat 5.0.28,
the submit button works correctly.
It looks like it was a problem in my sitemap structure. I have a form,
that uses Ajax, in a sub sitemap. My root sitemap does some aggregation
(it includes a menu and tabs with the generated pages from the sub
sitemap). This code (from the root sitemap) breaks the submit button:
<map:match pattern="*/**" internal-only="true">
<map:mount check-reload="yes" src="{1}/" uri-prefix="{1}/"/>
</map:match>
<map:match pattern="**">
<map:read src="cocoon:/{1}"/>
</map:match>
But the following works correctly:
<map:match pattern="*/**">
<map:mount check-reload="yes" src="{1}/" uri-prefix="{1}/"/>
</map:match>
In both snippets, styling, browser update, etc. is done in the
subsitemap.
Somehow it is not allowed to read from the subsitemap (or use
map:aggregate, or whatever). Why is that, or what am I doing wrong?
Thanks,
Bart.
> -----Oorspronkelijk bericht-----
> Van: Bart Molenkamp
> Verzonden: maandag 16 oktober 2006 16:40
> Aan: [email protected]
> Onderwerp: Can't submit form in Ajax mode
>
> Hi,
>
> I'm trying to submit my form in Ajax mode, but I'm getting an
exception:
>
> java.lang.IllegalStateException: getWriter() has already been called
for
> this response
>
>
org.apache.coyote.tomcat5.CoyoteResponse.getOutputStream(CoyoteResponse.
> java:568)
>
>
org.apache.coyote.tomcat5.CoyoteResponseFacade.getOutputStream(CoyoteRes
> ponseFacade.java:148)
>
>
org.apache.cocoon.servlet.CocoonServlet.manageException(CocoonServlet.ja
> va:1316)
>
>
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1202)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
> I'm using Cocoon 2.1.9, Tomcat 5.0.27. When I use Jetty (the one
bundled
> with Cocoon) I'm not having this problem.
>
> For example, take the example
'samples/blocks/forms/do-sampleTree.flow'
> (an ajax enabled form with a submit widget). It seems that the submit
> widget also produces an Ajax request, but I don't think that this is
> correct. Is there any possibility to disable ajax behaviour on the
> submit button?
>
> Or is there some other problem?
>
> Thanks,
> Bart.