|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
File upload using Spring configurationHey all,
Has anyone done DWR file uploads using the Spring applicationContext based configuration? I see that there is a FileConverter in 3.x but I'm unsure how to take advantage of it. I don't have any Spring multipart stuff in my web.xml, which I see has caused some grief with others. I've got a method which takes a File. I've also tried some other types that the literature out there indicates can be used. public void upload(File file) throws IOException {...} //public void upload(byte[] bytes) throws IOException {...} //public void upload(InputStream in) throws IOException {...} //public void upload(FileTransfer file) throws IOException {...} And in my applicationContext I've got the bean declared. <bean name="myBean" class="MyClass" autowire="byType"> <dwr:remote javascript="Facade"> <dwr:include method="upload" /> </dwr:remote> </bean> And then there's some client code. <input type="file" id="upload"/> <button onclick="Facade.upload(dwr.util.getValue('file'));">Upload</button> When I do an upload I get this output: WARN Call:205 - No methods called class MyClass.upload' are applicable for the passed parameters. My hunch is I need to register FileConverter in my <dwr:configuration>, but I'm stumped on how. Any ideas? My next path to get this working is to try and do it programmatically, but that seems like a hack. Thanks, Tom |
|
|
Re: File upload using Spring configurationI would suggest downloading the war and looking at the upload example, although not integrated with Spring it should help.
On Fri, Oct 16, 2009 at 11:41 AM, tmclaugh <tom.mclaughlin@...> wrote:
|
|
|
Re: File upload using Spring configurationYes, just stepping back and looking at the example and thinking it through from the beginning helped me figure out my problem. It was as simple as having the HTML, of all things, wrong. Turns out file uploads work great on the spring side too.
|
|
|
Re: File upload using Spring configurationThanks Tom.
On Fri, Oct 16, 2009 at 1:16 PM, tmclaugh <tom.mclaughlin@...> wrote:
|
| Free embeddable forum powered by Nabble | Forum Help |