cancel
Showing results for 
Search instead for 
Did you mean: 

Spring Surf + Alfresco 3.2r: formdata not passed through

ruffie
Champ in-the-making
Champ in-the-making
We have been working on a project and started out with the SURF framework before it was part of Spring (or something) based on the energy sample, somwhere last year.
Lately we picked this up again and changed to the Spring Surf build (Roo project and all) for Alfresco 3.2. Everything seemed ok, however, forms we have that used to post data to the alfresco repository don't do so anymore.
Our endpoints are configured correctly in surf.xml as far as we know and there is connection being made, as other GET and POST (registration for example) methods do work.

The specific forms have a form action in such a way: "${url.context}/proxy/<<endpoint id>>/<<webscript folder>>/<<webscript name>>" and are multipart/form-data.

So the form connects to a alfresco webscript which should collect the field values (for each (field in formdata.fields)), but the data isn't there. This used to work with the 'old' surf framework. The alfresco webscript is being processed as we get an error catch that comes from that webscript.

Monitoring the POST process the field data is being sent, but after reaching the proxy it somehow loses this…

Any ideas?

Additional info: this form has an upload field and has enctype multipart/form-data.
2 REPLIES 2

darryl_staflund
Champ in-the-making
Champ in-the-making
On a similar discussion in the Spring Surf forums:

http://forum.springsource.org/showthread.php?t=88197

the problem has just been diagnosed as a bug in the Spring Surf project and patched in rev. 407 of trunk.  Hope this helps.

Darryl

kevinr
Star Contributor
Star Contributor
There was a problem with the configuration in the SpringSurf config for sample apps. A bean to handle multi-part form data was incorrectly being applied - which was attempting to read the request before the proxy had a chance to deal with it:
    <bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver" id="multipartResolver">
      <property name="maxUploadSize" value="10000000"/>
   </bean>

this bean has now been removed from the samples!! (Alfresco Share did not have that bean def in its config - which is why we never saw the problem there…) It is working fine in RC1/RC2 from my tests.

Cheers,

Kev