DWR

DWR 3.0.M1 fileupload in a struts 2.0.11 application

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.0.M1
  • Fix Version/s: 4.0
  • Component/s: None
  • Description:
    Hide
    I am trying to upload an image through a DWR call in a struts2.0.11 application.

    My dwr.jar version details are:
    version: 3.0.M1
    scc-info: $Id: dwr-version.properties,v 1.63 2008/02/20 14:53:16 joe_walker Exp $

    My dwr.xml entries are:
    <create creator="new" javascript="imageUpload">
    <param name="class" value="mypackage.TestImageUpload"/>
    <include method="uploadFiles"/>
    </create>

    and the web.xml entries:
    ...
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
    </filter>

    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

    <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>

    <init-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>
    ....

    When i am using the file upload i am getting this alert: "Failed to find parameter: callCount"
    The dwr call to upload the image works fine if the struts filter mappings are commented(which is tested as a separate html as well as jsp), but the application fails as it requires the filter mapping entries...

    Show
    I am trying to upload an image through a DWR call in a struts2.0.11 application. My dwr.jar version details are: version: 3.0.M1 scc-info: $Id: dwr-version.properties,v 1.63 2008/02/20 14:53:16 joe_walker Exp $ My dwr.xml entries are: <create creator="new" javascript="imageUpload"> <param name="class" value="mypackage.TestImageUpload"/> <include method="uploadFiles"/> </create> and the web.xml entries: ... <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> .... When i am using the file upload i am getting this alert: "Failed to find parameter: callCount" The dwr call to upload the image works fine if the struts filter mappings are commented(which is tested as a separate html as well as jsp), but the application fails as it requires the filter mapping entries...

Activity

Hide
Joe Walker added a comment - 30/Oct/08 5:45 PM

Could you turn DWR debug (everything through org.directwebremoting) to DEBUG level and tell me a stack trace?
Thanks.

Show
Joe Walker added a comment - 30/Oct/08 5:45 PM Could you turn DWR debug (everything through org.directwebremoting) to DEBUG level and tell me a stack trace? Thanks.
Hide
Lance Semmens added a comment - 21/May/09 10:57 AM

This issue was caused by the struts2 multipart interceptor parsing the request before DWR could get to it

http://www.nabble.com/DWR-3-%2B-Spring-Security:-File-upload-td23256643.html

Show
Lance Semmens added a comment - 21/May/09 10:57 AM This issue was caused by the struts2 multipart interceptor parsing the request before DWR could get to it http://www.nabble.com/DWR-3-%2B-Spring-Security:-File-upload-td23256643.html

People

Dates

  • Created:
    05/Aug/08 2:51 PM
    Updated:
    21/May/09 10:57 AM
    Resolved:
    21/May/09 10:57 AM