开发者

Integrating Seam app with flash file uploader

开发者 https://www.devze.com 2022-12-19 12:07 出处:网络
I have a seam app and would like to use the MultiPowUploader (http://www.element-it.com/multiple-file-upl开发者_如何学Pythonoad/flash-uploader.aspx). They give some processing script files (.asp, .asp

I have a seam app and would like to use the MultiPowUploader (http://www.element-it.com/multiple-file-upl开发者_如何学Pythonoad/flash-uploader.aspx). They give some processing script files (.asp, .aspx, .php), including a .jsp. One should define a flashvar parameter with the relative path of the script. When I try to upload, I get the following errors:

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 6 in the generated java file Only a type can be imported. org.apache.commons.fileupload.FileItem resolves to a package

An error occurred at line: 7 in the generated java file Only a type can be imported. org.apache.commons.fileupload.servlet.ServletFileUpload resolves to a package

An error occurred at line: 8 in the generated java file Only a type can be imported. org.apache.commons.fileupload.disk.DiskFileItemFactory resolves to a package

I included the commons-fileupload-1.2.1.jar. Even if this would work, I don't think this is the best way to do it, having this in a .jsp when the app does not use any .jsp...

Any advice? Thanks!


First of all, it's indeed considered bad practice to write raw Java code down in a JSP file instead of a real Java class. You should in fact have used a Servlet for this.

As to your problem, those compilation errors boils down to the particular classes being missed in the runtime classpath. I understand that it just works in your dev environment, is it true? Where have you actually included the JAR file? It ought to be in webapp's /WEB-INF/lib to get it all to work, not somewhere outside such as in Appserver/lib or even more worse the JRE/lib.

0

精彩评论

暂无评论...
验证码 换一张
取 消