views:

182

answers:

1

Hello!

I have a seam app and would like to use the MultiPowUploader (http://www.element-it.com/multiple-file-upload/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!

+1  A: 

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.

BalusC
Thank you for your answer BalusC. Indeed the libs were at the wrong place! Yet, the upload component is still not working, if anyone has experience integrating this, please let me know!
GuilhermeA
You're welcome. As to your new question, just `Ask Question` with more info/details about the problem.
BalusC