jwBurnside
jwBurnside

Reputation: 867

Deploy a War file with Eclipse and Tomcat 6 without a build file

I know there are a bunch of posts on this topic, but I can't seem to figure it out. Here is my setup: - Eclipse Indigo - Tomcat 6 - Struts WAR file that I imported into Eclipse from http://www.manning.com/dbrown/SampleApplication.zip

I added the server to Eclipse, and added the project to the server. It runs fine, but I'd like to make some changes to the XML and java files (not the jsp files). I was under the impression that Eclipse takes care of the deployment after I save and restart the server, but I guess this isn't the case. I looked into creating an ant file to do a custom build, but I'm not really sure how to make it since I don't even know how to do a deployment "manually". How would I go about doing a manual deployment? Thanks.

Upvotes: 2

Views: 2875

Answers (2)

Sarin Jacob Sunny
Sarin Jacob Sunny

Reputation: 2138

A war file is usually created by exporting it from an IDE like eclipse, netbeans, etc.

While generating a war file there is 2 options,

  • You can include your java files with it
  • You can avoid java files from it. In both the cases class files will be there which are created from java files. Class files will be able to take care of the actions of java class.

If the war file which you down loaded is not having those java files, you will not be able to use it with eclipse, where as it will work fine if you are putting it into tomcat directory for running.

For running a war file manually just put it into tomcat webapps folder and run tomcat.

Then you can access the pages using the url.

http://localhost:8080/yourprojectname/

If you want to check whether the war file contains any java files, after starting the tomcat server it will extract the war file into the same directry, where you can search for java files.

If you want to run the project from eclipse,

import it into eclipse, open index.jsp page right click-> run as-> run on server

if you have not yet configured the server yet,select the server in the list, specify its installation path, then add projects into server in next step, finish it. then it will load your project.

Please provide little more details so that we can help you better.

Upvotes: 3

digitebs
digitebs

Reputation: 852

manual: copy the war in the tomcat folder then start tomcat.

if you want to use eclipse you need to click redeploy war first by right clickling the deployed war in the servers tab under tomcat.

Upvotes: 1

Related Questions