Results 1 to 3 of 3
  1. #1
    Gary20 is offline Member
    Join Date
    Jan 2011
    Posts
    18
    Rep Power
    0

    Default How do you import?

    Copied some code that uploads files in a servlet. But there are some imports that don't work out. What is the correct way to import files?

    The import:
    Java Code:
    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.FileUploadException;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    The error:
    Java Code:
    The import org.apache.commons cannot be resolved
    How can I fix this?

    Thanks!

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    Most likely you do not have the appropriate library (.jar) on your classpath. See
    PATH and CLASSPATH (The Java™ Tutorials > Essential Classes > The Platform Environment)
    FileUpload - Home

  3. #3
    Gary20 is offline Member
    Join Date
    Jan 2011
    Posts
    18
    Rep Power
    0

Similar Threads

  1. How can I Import ejb components according to our need?
    By benyahia4 in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 12-28-2010, 08:24 PM
  2. Help with import
    By eel in forum New To Java
    Replies: 2
    Last Post: 09-19-2010, 10:51 AM
  3. Import
    By gothrog in forum Java Applets
    Replies: 2
    Last Post: 05-13-2010, 11:16 PM
  4. Can not import jxl.*
    By AnnieDing in forum Java Servlet
    Replies: 3
    Last Post: 01-22-2010, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •