使用 Java Web Start (JNLP) 部署 *.war 应用程序
我想使用 Java Web Start (JNLP) 推出 Web 应用程序 (*.war)。我的起始条件是我在客户端有一个正在运行的已配置 Tomcat 6.0 服务器。 tomcat 的正常部署对我来说非常清楚。只需将 *.war 文件放入 webapps 文件夹并重新启动 tomcat - 完成。
如果我想对 JNLP 做同样的事情,它看起来有点复杂。我正在考虑以下 JNLP:
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for JimageConnect.com JTwacker Application -->
<jnlp codebase="file:///local_installer">
<information>
<title>War deployment</title>
<vendor>Vendor</vendor>
<description>long </description>
<description kind="short">short</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="deployment.jar"/>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
</resources>
<application-desc main-class="com.vendor.deployment.Deploy" />
其中,deployment.jar 包含
:-) 应该部署的 *.war 文件
-) 使用命令行重新部署 Web 应用程序所需的一切,如 http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Executing_Manager_Commands_With_Ant
-) 类 Deploy 从类加载器读取 *.war 作为 Stream 并执行 tomcat 的取消部署/部署。
该解决方案应该可行,但它看起来是手工制作的,而且有些丑陋。有更好的解决方案吗?
I want to rollout a web application (*.war) with Java Web Start (JNLP). My starting condition is that I have a running configured Tomcat 6.0 server available at the client.
Normal deployment at tomcat is pretty clear to me. Just put the *.war file to the webapps folder and restart tomcat - finished.
If I want to the same with JNLP it looks somehow complicated. I was thinking about the following JNLP:
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for JimageConnect.com JTwacker Application -->
<jnlp codebase="file:///local_installer">
<information>
<title>War deployment</title>
<vendor>Vendor</vendor>
<description>long </description>
<description kind="short">short</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="deployment.jar"/>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
</resources>
<application-desc main-class="com.vendor.deployment.Deploy" />
Where deployment.jar holds:
-) the *.war file which should be deployed
-) everything which is needed to use command line redeployment of web application descibed at http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Executing_Manager_Commands_With_Ant
-) the class Deploy which reads the *.war as Stream from the classloader and executes an undeployment/deployment for tomcat.
That sollution should work but it looks hand made and somehow ugly. Is there a better solution available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过创建一个客户安装程序来解决这个问题,该安装程序安装了我的 Tomcat 服务器,甚至正确处理了 UAC。
如果需要,第二个工具部署了我的应用程序。
I solved the problem by creating a customer installer which installed my Tomcat server and even handled UAC correctly.
A second tooling deployed my application if needed.