Eclipse 输出文件夹 [英] Eclipse Output Folders

查看:32
本文介绍了Eclipse 输出文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下结构,如何让 Eclipse 正确构建 WAR 文件?

With following structure, how can I make Eclipse build the WAR file correctly?

我需要以下文件夹才能进入以下输出文件夹:

I need following folders to go into following output folders:

ma​​il/srcma​​il/war/WEB-INF/classes

ma​​il/wwwma​​il/war/

我已尝试在 Eclipse 中设置输出文件夹,但这不会导致任何结果,但 Eclipse 会神奇地删除所有 WEB-INF 内容而不告诉我!

I have tried setting the Output folders in Eclipse, but that doesn't result in anything but Eclipse magically deleting all WEB-INF content without telling me!

http://clausjoergensen.dk/media/files/gwt-pro-stru.png

推荐答案

我通常不使用Web 应用程序项目"向导创建我的 GWT 项目,因为我不想删除所有默认的 servlet 和类.我通常将它们创建为动态 Web 项目",这将允许您导出为 WAR 等内容.

I don't typically create my GWT projects using the "Web Application Project" wizard as I don't like having to remove all default servlets and classes. I usually create them as "Dynamic Web Projects" which will allow you to export as a WAR among other things.

  1. 创建一个新的动态 Web 项目"并根据您的项目首选项完成向导的第一步.
  2. 选择下一步">下一步"进入Web 模块"配置设置.
  3. 输入您的上下文根并将内容目录"更改为war",然后单击完成"

这只会为您创建一个基本的 Web 项目,接下来您需要在该项目上启用 GWT 并添加基本配置.

This will create you just a basic web project you will next need to enable GWT on this project and add you base configurations.

  1. 打开您的项目属性并转到Google">Web Toolkit"并选中Use Google Web Toolkit"选择Ok"关闭此对话框.
  2. 选择文件">新建">其他"打开新的新建"对话框.选择Google Web Toolkit"文件夹,然后选择模块",然后选择下一步"
  3. 输入您的包信息和模块名称.这将在您输入的包中创建您的 ModuleName.gwt.xml 文件.它还会为您创建一个空的 your.package.name.client.
  4. 再次选择文件">新建">其他",这次选择入口点类".在打开的向导中确认模块、包和源是正确的.输入入口点的名称",这通常是您的模块名称.然后选择完成"
  5. 再次选择文件">新建">其他",然后选择HTML 页面".确认路径"指向战争"并且模块"显示您的模块.输入文件名",这可以是您想要的任何内容,即 index.html、index.jsp、module.html

此时您有一个完全启用 GWT 的动态 Web 项目.要正确设置运行设置,只需从菜单中选择运行"并再次选择运行".然后从对话框中选择Web 应用程序".

At this point you have a Dynamic Web Project that is fully GWT enabled. To get the run setting set up properly just select "Run" from the menu and select "Run" again. Then select "Web Application" from the dialog box.

这篇关于Eclipse 输出文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆