?
Solved

import class

Posted on 2005-04-17
8
Medium Priority
?
1,317 Views
Last Modified: 2008-02-01
how to import class to jsp file?
classe stored in : C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib\classes\fileupload

<%@ page session="true" buffer="16kb" autoFlush="true" import="fileupload.*" %>
i got error:
org.apache.jasper.JasperException: Unable to compile class for JSP
FileUpload cannot be resolved
DiskFileUpload cannot be resolved or is not a type

0
Comment
Question by:ethar1
  • 4
  • 3
8 Comments
 
LVL 8

Accepted Solution

by:
koppcha earned 1400 total points
ID: 13801892
typicall you will keep java files in WEB-INF/classes folder not in WEB-INF/lib/classes folder.If i have a java class file in ROOT/WEB-INF/classes/fileupload folder and by JSP is in ROOT/ folder then i can use the below statement to include the class
<%@ page import="fileupload.*" %>
0
 

Author Comment

by:ethar1
ID: 13801942
Still same error
0
 

Author Comment

by:ethar1
ID: 13801950
The type org.apache.commons.fileupload.FileUploadBase cannot be resolved. It is indirectly referenced from required .class files
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Expert Comment

by:koppcha
ID: 13802026
do you have the class file for this pogram FileUploadBase .java in the directory?
0
 
LVL 29

Assisted Solution

by:bloodredsun
bloodredsun earned 600 total points
ID: 13802056
the classes need to be in either a jar or in a directory structure under the classes dir that matches the package structure.

e.g.to include the fileupload classes
<%@ page session="true" buffer="16kb" autoFlush="true" import="org.apache.commons.fileupload.*" %>

works for
WEB-INF/lib/fileupload.jar
and
WEB-INF/classes/org/apache/commons/fileupload/FileUploadBase.class
0
 

Author Comment

by:ethar1
ID: 13802551
I have this : FileUploadBase.class in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\fileupload
0
 
LVL 8

Expert Comment

by:koppcha
ID: 13802576
Please check the following
1>Do you have the package statement in all the files under the
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\fileupload directory ..i mean
package fileupload;
2>Is your JSP in this location
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF ?

0
 
LVL 8

Expert Comment

by:koppcha
ID: 13802581
Thanks for the Grade..Hope you resolved the issue
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
Over time, the online landscape has altered considerably, but that’s nothing compared to the up-and-coming trends that will shape the web design industry in the coming year. Keep reading to find out which trends will shape B2B web design in 2018.
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month14 days, 6 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question