oi pessoal
estou tentando implementar upload de vários arquivos no vraptor porém esta dando uma exceçao…
Meu código java é este:
@Post @Path("/photo/upload")
public void upload(UploadedFile upload) throws IOException {
System.out.println( "PhotoController.upload()" );
}
e meu código jsp é este:
<script type="text/javascript">
//<!--
$(function(){
var btnUpload=$('#upload');
var status=$('#status');
new AjaxUpload(btnUpload, {
action: '/vibro/photo/upload',
//Name of the file input box
name: 'uploadfile',
onSubmit: function(file, ext){
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
// check for valid file extension
status.text('Only JPG, PNG or GIF files are allowed');
return false;
}
status.text('Uploading...');
},
onComplete: function(file, response){
//On completion clear the status
status.text('');
//Add uploaded file to list
if(response==="success"){
$('<li></li>').appendTo('#files').html('<img src="./uploads/'+file+'" alt="" /><br />'+file).addClass('success');
} else{
$('<li></li>').appendTo('#files').text(file).addClass('error');
}
}
});
});
//-->
</script>
<!-- Upload Button-->
<div id="upload" >Upload File</div><span id="status" ></span>
<!--List Files-->
<ul id="files" ></ul>
mas quando ele chama o método tenho esta exceçao:
Caused by: java.lang.IllegalArgumentException: Vraptor does not support this interface or abstract type: br.com.caelum.vraptor.interceptor.multipart.UploadedFile
at br.com.caelum.vraptor.http.ognl.GenericNullHandler.instantiate(GenericNullHandler.java:69)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createOgnlContextFor(OgnlParametersProvider.java:184)
alguém tem alguma dica?
obrigado