Upload Image (File) Error!

38 views
Skip to first unread message

rend...@gmail.com

unread,
Sep 30, 2014, 3:47:23 AM9/30/14
to google-s...@googlegroups.com
1、com.google.sitebricks.routing.InvalidEventHandlerException: Encountered an argument not annotated with @Named and not a valid injection key in event handler method: public com.google.sitebricks.headless.Reply web.FileService.uploadPhoto(com.google.sitebricks.headless.Request) Key[type=com.google.sitebricks.headless.Request<org.apache.commons.fileupload.FileItem>, annotation=[none]]
2、Service Method:
@Post
public Reply<?> uploadPhoto(Request<FileItem> files) {
}
3、already add SitebricksUploadExtModule:
public class AppConfig extends GuiceServletContextListener {
@Override
public Injector getInjector() {
return Guice.createInjector(new SitebricksUploadExtModule(){

},new SitebricksModule() {
@Override
protected void configureSitebricks() {
scan(FileService.class.getPackage());
}
});
}
}

Dhanji R. Prasanna

unread,
Oct 1, 2014, 11:33:40 AM10/1/14
to google-s...@googlegroups.com
Yea unfortunately we don't bind FileItem as a provider yet. You can simply @Inject the HttpServletRequest and use commons-fileupload that way.

I need to sort out all these things, will do shortly. Apologies!


--
You received this message because you are subscribed to the Google Groups "Google Sitebricks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-sitebri...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages