Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
452 views
in Technique[技术] by (71.8m points)

java - Eclipse Output Folders

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

I need following folders to go into following output folders:

mail/src into mail/war/WEB-INF/classes

mail/www into mail/war/

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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. Create a new "Dynamic Web Project" and complete the first step of the wizard based off you project preferences.
  2. Select Next > Next to get you to the "Web Module" configuration settings.
  3. Enter your context root and change your "Content Directory" to "war" and click "Finish"

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. Open your project Properties and goto "Google" > "Web Toolkit" and check "Use Google Web Toolkit" Select "Ok" to close this dialog box.
  2. Select "File" > "New" > "Other" to open the new "New" dialog box. Select "Google Web Toolkit" folder then select "Module" then "Next"
  3. Enter your package info and module name. This will create you your ModuleName.gwt.xml file in the package you entered. It will also create a empty your.package.name.client for you.
  4. Select "File" > "New" > "Other" again and this time select "Entry Point Class." In the wizard that opens confirm that Module, Package, and Source are correct. Enter the "Name" of the Entry point, This would typically be your module name. Then select "Finish"
  5. One more time select "File" > "New" > "Other" and select "HTML Page." Confirm that "Path" is pointing to "war" and "Modules" displays your module. Enter the "FileName" this can be anything you want i.e. index.html, index.jsp, module.html

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...