将几个单独的文件导入到Eclipse项目中

时间:2023-01-18 22:06:58

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.

我有几个文件包含一个tomcat web应用程序,我需要将其导入到eclipse项目中,以便我可以轻松地从它们创建一个EAR文件。

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

出于隐私原因,我更改了一些文件夹+文件的名称。

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

我的文件目前都在'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'包含一些HTML和JSP文件(我的应用程序的表单)以及JavaScript .js文件和CSS文件。

  • 'test' also contains the folder 'WEB-INF' which contains a TLD file, and my web.xml file.
  • 'test'还包含'WEB-INF'文件夹,其中包含一个TLD文件和我的web.xml文件。

  • 'WEB-INF' contains a 'lib' folder, with two .jar files.
  • 'WEB-INF'包含一个'lib'文件夹,带有两个.jar文件。

  • 'WEB-INF' also contains the 'classes' folder, which merely contains the 'helpers' folder.
  • 'WEB-INF'还包含'classes'文件夹,它只包含'helpers'文件夹。

  • The 'helpers' folder contains all the java source code- several servlets, and one helper class that does database communication stuff.
  • 'helpers'文件夹包含所有java源代码 - 几个servlet,以及一个执行数据库通信的辅助类。

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

我如何将这些导入Eclipse中的新项目?

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

我想要导入所有内容,包括我的js,css,jsp和html,而不仅仅是java

2 个解决方案

#1


0  

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.

从eclipse,您只能从现有的Web应用程序导入“war”文件。如果你有war文件,你可以直接执行此操作,否则你必须创建一个web项目并手动将文件添加到相应的项目文件夹。

#2


0  

Well I have Eclipse Indigo and for testing I just created a new project. I right clicked on the project folder and selected import. In the new window I selected General->FileSystem and then just browsed to the files I wanted (no matter the extension). Is this what you're referring to?

我有Eclipse Indigo,为了测试,我刚创建了一个新项目。我右键单击项目文件夹并选择导入。在新窗口中,我选择了General-> FileSystem,然后浏览了我想要的文件(无论扩展名)。这是你指的是什么?

#1


0  

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.

从eclipse,您只能从现有的Web应用程序导入“war”文件。如果你有war文件,你可以直接执行此操作,否则你必须创建一个web项目并手动将文件添加到相应的项目文件夹。

#2


0  

Well I have Eclipse Indigo and for testing I just created a new project. I right clicked on the project folder and selected import. In the new window I selected General->FileSystem and then just browsed to the files I wanted (no matter the extension). Is this what you're referring to?

我有Eclipse Indigo,为了测试,我刚创建了一个新项目。我右键单击项目文件夹并选择导入。在新窗口中,我选择了General-> FileSystem,然后浏览了我想要的文件(无论扩展名)。这是你指的是什么?