jose
jose

Reputation: 144

Deploying Struts2 project

How can i deploy a struts2 web application in tomcat? I want to avoid eclipse from
deploying environment.

My project was created with Eclipse IDE and i am using MySQL database and Tomcat server.
It can be successfully deployed from that environment.

I mean how can I will be host struts2 application in a web server using apache tomcat 7.

Thank's

Upvotes: 0

Views: 2226

Answers (2)

admenva
admenva

Reputation: 2421

The answers posted so far are correct: you should export a War file and place it in your Tomcat's webapps folder. However, this manual procedure may not be the best solution, specially if you are developing, so I usually use Ant to automate it.

Upvotes: 1

madhairsilence
madhairsilence

Reputation: 3870

You created an application in Eclipse and you gave Run as -> Run on Server. It worked properly.

Now you dont want to give Run as-> Run on Server, instead you want to run tomcat separately and use external browser to access the application.

If this is the Scenario. The solution could be

  1. Right Click the Project in Eclipse
  2. Export -> War File
  3. Move the created WAR file in to the tomcat deploy folder ( usually web app folder).

If you are using any JAR files, you can include them in two ways.

  1. Right Click -> Build Part -> Order and Export : And select the JAR you want to bundle along with the WAR file. So , that your WAR will work in any server.

  2. Double click the Server in the server console. Open Launch Configuration -> Classpath -> Add External JARs. Now your server is carrying the library making your WAR file fully dependant on Server

Upvotes: 2

Related Questions