Search code examples
javaeclipsejspimportear

Importing several individual files into an eclipse project


I have several files comprising a tomcat web application that I need to import into an eclipse project so that I can easily create an EAR file from them.

I have changed the names of some folders + files for privacy reasons.

My files are currently all in the folder 'test'.

  • 'test' contains some HTML and JSP files (the forms for my application) as well as a JavaScript .js file and a CSS file.
  • 'test' also contains the folder 'WEB-INF' which contains a TLD file, and my web.xml file.
  • 'WEB-INF' contains a 'lib' folder, with two .jar files.
  • 'WEB-INF' also contains the 'classes' folder, which merely contains the 'helpers' folder.
  • The 'helpers' folder contains all the java source code- several servlets, and one helper class that does database communication stuff.

How would I import these into a new project in Eclipse?

I want everything to import, including my js, css, jsp and html, not just the java


Solution

  • Joseph,

    From eclipse you can import only 'war' files from the existing web application. If you have the war file you can directly do this, else you have to create a web project and manually add your files to the corresponding project folders.