在Eclipse之外将tom MVC应用程序部署到tomcat后面会发生什么? [英] What happens behind the scenes of deploying a Spring MVC application to tomcat outside of eclipse?

查看:94
本文介绍了在Eclipse之外将tom MVC应用程序部署到tomcat后面会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为使用像eclipse这样令人敬畏的IDE的一个缺点就是你错过了应用程序幕后发生的事情。我是一个红宝石开发人员,所以不是一个java老手。所以我一直用java编写项目,并使用Spring框架进行IOC和MVC。有人可以向我解释当我在eclipse中选择在服务器上运行时会发生什么吗?因为最终我将把这个应用程序的杰作部署到Linux服务器上。这是我的设置。我在eclipse中使用Spring MVC 3和maven插件。在pom.xml文件中,我有最新的spring发行版本,log4j,spring mvc,spring context等。

I guess a drawback of using such an awesome IDE like eclipse is that you miss the point for what happens behind the scenes of an application. I'm a ruby developer so not a java veteran. So I've been coding a project in java and using the spring framework for IOC and MVC. Can someone explain to me what is going on when I select run on server in eclipse? Because eventually I will be deploying this masterpiece of an application to a Linux server. Here is my setup. I am using Spring MVC 3 and the maven plugin in eclipse. In the pom.xml file, I have stuff like latest spring release version, log4j, spring mvc, spring context etc.

我一直在使用localhost测试我的应用程序在eclipse IDE中运行服务器的方便选项。 eclipse中的服务器配置指向我已安装tomcat 7的tomcat目录位置。请揭开幕后发生的情况以及如果我想在生产服务器上部署此应用程序,我需要做些什么。越详细越好。非常感谢。

I have been testing my application on localhost using the handy option of run on server in the eclipse IDE. The server configuration in eclipse is pointing to the tomcat directory location for where I have installed tomcat 7. Please demystify what happens behind the scenes and what I will need to do if I want to deploy this application on a production server. The more detail the better. Thanks a ton in advance.

推荐答案

将Web应用程序部署到Tomcat就像这样简单(假设安装了Tomcat)

Deploying a web application to Tomcat is as simple as this (assuming Tomcat is installed)


  1. 使用 .war 中/en.wikipedia.org/wiki/WAR_file_format_%28Sun%29\"rel =nofollow>格式正确

  2. 移动生成的 .war 将文件发送到Tomcat安装文件夹的 / webapps 目录。

  3. 运行 / bin / startup。[sh | bat] Tomcat安装文件夹中的脚本。

  1. Bundle your application in a .war with the correct format.
  2. Move the generated .war file to the /webapps directory of your Tomcat installation folder.
  3. Run the /bin/startup.[sh|bat] script in the Tomcat installation folder.

注意您可以执行配置部署的中间步骤,例如更改上下文路径。 查看Tomcat文档以获取详细信息。

Note that there are intermediate steps you can do to configure the deployment, like changing your context path. Go through the Tomcat documentation for details.

在第3步中,Tomcat将 .war 内容解压缩到 / webapps .war 文件同名的文件夹。它将使用它作为上下文路径。脚本本身通过将 WEB-INF / [class | lib | ...] 放到 java 进程来启动类路径以及一些Tomcat库。

In step 3, Tomcat will extract the .war contents to a directory in the /webapps folder with the same name as your .war file. It will use this as the context path. The script itself launches a java process by putting the WEB-INF/[class|lib|...] onto the classpath along with some Tomcat libraries.

因此Eclipse基本上为您完成了上述所有步骤。

So Eclipse basically does all the steps above for you.

这篇关于在Eclipse之外将tom MVC应用程序部署到tomcat后面会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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