用于演示 Web 应用程序的 Slim 应用程序服务器?
我有一个小型宠物网络应用程序项目,我想向那些自己没有应用程序服务器(并且对应用程序服务器一无所知)的人展示。
他们让我的 WAR 文件以零配置运行的最简单、最快的方法是什么,最好是我可以与 WAR 文件一起发送或捆绑的东西? 例如,有 Jetty 的精简版吗? 还有别的事吗?
I have a little pet web app project I'd like to show someone who doesn't have an application server themselves (and who has no clue about application servers).
What is the easiest and quickest way for them to get my WAR file running with zero configuration, preferably something I could send along with or bundle with the WAR file? Is there a slimmed down version of Jetty, for example? Something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以轻松地自己创建精简版本。
http://docs.codehaus.org/display/JETTY/Embedding+Jetty
http://jetty.mortbay.org/xref/org /mortbay/jetty/example/LikeJettyXml.html
要运行嵌入式 Jetty,您只需要在类路径上添加以下 jar:
非常轻...
或者,Maven 插件 也可以工作。
You can create the slimmed down version yourself easily.
http://docs.codehaus.org/display/JETTY/Embedding+Jetty
http://jetty.mortbay.org/xref/org/mortbay/jetty/example/LikeJettyXml.html
To run embedded Jetty you need only the following jars on the classpath:
Very light...
Alternatively, the Maven plugin can work as well.
如果您使用 maven,有一个 jetty maven 插件可以将您的 war 部署到 jetty 的嵌入式实例。
但即便如此,根据你的应用程序需要什么类型的东西,jetty 甚至 tomcat 都会做。
If you're using maven, there's a jetty maven plugin that can deploy your war to an embedded instance of jetty.
But even otherwise, depending on what sort of stuff your app needs, jetty or even tomcat will do.
如果你不知道或者不想搞乱maven,你可以尝试 Jetty-runner
https://svn.codehaus.org/jetty-contrib/trunk/jetty-runner
jetty-runner.jar 是一个可以从命令行运行的 jar 文件,如下所示:
java -jar jetty-runner .jar my.war
If you don't know or do not want to mess with maven you could try Jetty-runner
https://svn.codehaus.org/jetty-contrib/trunk/jetty-runner
jetty-runner.jar is one jar file that you can run from command line like so:
java -jar jetty-runner.jar my.war
我肯定会创建一个嵌入jetty并使用你的war的可执行jar。 Maven 的东西可能没问题,但是自己编写单个 main 函数非常容易。
I would definitely just create an executable jar that embeds jetty and uses your war. The maven thing might be ok, but it's pretty easy to just write the single main function yourself.