简体   繁体   English

如何将Java项目部署到Tomcat

[英]How to deploy Java project to Tomcat

I have downloaded a sample extjs+mysql+spring web project ( link ) with a java backend that I'd like to set up locally on my machine. 我已经下载了一个示例extjs + mysql + spring web项目( 链接 )和一个java后端,我想在我的机器上本地设置。 I have installed Tomcat server, and MySQL DB but it's my first time ever with a java-based web application and I have troubles setting it up. 我已经安装了Tomcat服务器和MySQL数据库,但这是我第一次使用基于java的Web应用程序而且设置起来很麻烦。 Does it require any modifications ? 是否需要进行任何修改? I thought that .jsp files should be included there, but I can only see .java sources. 我认为.jsp文件应该包含在那里,但我只能看到.java源代码。 Do I need to build it before it's ready for deployment ? 在准备好部署之前,我是否需要构建它? Any help appreciated. 任何帮助赞赏。

This is an Eclipse project so you'd need to run it from within Eclipse. 这是一个Eclipse项目,因此您需要在Eclipse中运行它。

  • Download Eclipse 下载 Eclipse
  • Open the project in it 在其中打开项目
  • Define a Tomcat container in your Servers tab 在Servers选项卡中定义Tomcat容器
  • Drag and drop the project onto the newly defined Tomcat 将项目拖放到新定义的Tomcat上
  • Run it 运行

if your are using eclipse IDE for development, create a project in eclipse, run as "run on server" , and set the running server (eg TOMCAT 7). 如果您正在使用eclipse IDE进行开发,请在eclipse中创建一个项目,以“在服务器上运行”的方式运行,并设置正在运行的服务器(例如TOMCAT 7)。 and thats it,, make sure, you correctly setup spring project in IDE with all needed jar files . 这就是它,确保你在IDE中正确设置了所有需要的jar文件的spring项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM