java 在tomcat中部署一个jar

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13648760/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 13:30:05  来源:igfitidea点击:

Deploy a jar in tomcat

javatomcat

提问by user1866731

It is possible deploy a simple jar in tomcat and it run that???

可以在 tomcat 中部署一个简单的 jar 并运行它???

A simple example,is just execute main and print a hello world :P

一个简单的例子,就是执行 main 并打印一个 hello world :P

回答by Toni Toni Chopper

No, it's not. You have to create a web app that includes your jar and a servlet (as a bare minimum).

不,这不对。您必须创建一个包含 jar 和 servlet(作为最低要求)的 Web 应用程序。

Have a look at this http://docs.oracle.com/javaee/6/tutorial/doc/bnafd.html

看看这个http://docs.oracle.com/javaee/6/tutorial/doc/bnafd.html

回答by Dave Newton

No.

不。

Tomcat is a web app container, you need to deploy a web app.

Tomcat 是一个 web app 容器,你需要部署一个 web app。