File Uploads with DWR 3.0 M1 fails

View: New views
1 Messages — Rating Filter:   Alert me  

File Uploads with DWR 3.0 M1 fails

by hansamann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I was searching the nabble archive but still am not quite sure how FileUploads are supposed to work with 3.0 M1. I have a test implementation of my webapp that currently give me the error: Parameter callCount not defined!

When I do a normal DWR request that does not involve a file upload, it still works fine (as it was in DWR 2.0.3).

We are using Spring, so DWR is conifgured using this in one of the spring xml files:

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/engine.js">dwrController</prop>
                <prop key="/util.js">dwrController</prop>
                <prop key="/interface.js">dwrController</prop>
                <prop key="/call/**">dwrController</prop>
                <prop key="/interface/**">dwrController</prop>
            </props>
        </property>
    </bean>

    <dwr:controller id="dwrController" debug="true" />
   
    <dwr:configuration>
       
    </dwr:configuration>

The Bean that exposes methods is this:

    <bean id="AJAXController" class=" ... ">
      ...
        <dwr:remote javascript="Mac">
            <dwr:include method="checkIO"/>
            <dwr:include method="checkImage"/>
        </dwr:remote>
    </bean>

On the client side, I call the checkImage function liek this:

//DWR
        var creative = dwr.util.getValue(fieldId);
        //YAHOO.log(creative);
        Mac.checkImage(creative, c.width, c.height, c.size, fieldId,
        {
              callback: function(result)
              {
                  alert("Image check: " + result);
                 
            },
            timeout: 5000,
              errorHandler: function(message)
              {
                  alert("Oops: " + message);
              }
         
        });

I verified that the parameter creative really is resolved into the input element that I want to upload.

The method on the server that I am trying ot invoke is this:

    public boolean checkImage(FileTransfer uploadImage, Integer width, Integer height, Float size, String creativeId ) throws IOException
    {
        log.debug("verifyImage()");
      ...
       
   
    }


Basically it never get's invoked. once Mac.checkImage ()... is called I get the error wiht

'Failed to find parameter: callCount'

Any ideas?

Could it be that DWR needs to be configured a bit differently in 3.0, especially when it comes to Spring?

Thanx
Sven

---
Sven Haiges
Y! Messenger / Skype: hansamann