将war文件转换为可执行文件 [英] Converting a war file into an executable file

查看:147
本文介绍了将war文件转换为可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司开发了一个Web应用程序(J2EE环境/ Tomcat服务器),并希望将其作为产品销售。客户可以将此产品用作基本版或高级版。在高级版中,客户有一些额外的功能(可能是一些额外的链接)。这种区别是基于序列密钥进行的。

My company has developed a web application (J2EE environment/Tomcat server) and wants to sell it as a product. Customers can avail this product as basic edition or premium edition. In the premium edition the customers have some extra functionalities (may be some extra links). This distinction is made based on the serial key.

在讨论上述内容时,我只是一个倾听者。

I was just a listener when the above thing was discussed.

是否可以解决上述问题?我们如何将war文件转换为exe文件并嵌入逻辑以区分高级版或基本版。

Is doing the above problem possible? How do we convert a war file into an exe file and embed logic to distinguish premium or basic version.

推荐答案


我们如何将war文件转换为exe文件并嵌入逻辑来区分premium或基本版本。

How do we convert a war file into an exe file and embed logic to distinguish premium or basic version.

这两个不同的要求彼此无关。

These are 2 distinct requirements which have nothing to do with each other.

如果您有一个Web应用程序,您可以使用网页输入序列密钥(例如Jira就可以),或者您也可以在上下文中写入密钥(或密钥文件的文件名)。 xml,让servlet读取该上下文参数。根据密钥,应用程序可以允许或不允许某些功能。

If you have a web application you can either enter the serial key using a web page (like Jira does for instance), or you could perhaps let the key (or the filename of the keyfile) be written in Context.xml, and let a servlet read that context parameter. Based on the key the application could then allow or not allow some functionality.

至于转换为可执行文件,对可执行文件有多种解释。我认为war文件足够可执行 - 将它转储到tomcat中然后运行。

As for converting to an executable, there are multiple interpretations to the word executable. I for one think "war" file is executable enough - dump it in a tomcat and it runs.

如果你想要它是独立的,你可以用你的app提供一个tomcat发行版预部署(再次,像Jira一样),或使用Jetty嵌入式容器。虽然这可能不适合繁重的工作负载。

If you want it standalone you could provide a tomcat distribution with your app predeployed (again, like Jira does), or use a Jetty embedded container. Although that may not be appropriate for heavy workloads.

您甚至可以尝试使用gjc(Gnu Java编译器)将jetty +您的Web应用程序转换为本机exe,但我怀疑它将与正常部署的版本一样工作。

You could even try to convert jetty + your web app to a native exe using gjc (Gnu Java Compiler) though I doubt it will work as well as the normally deployed version.

我建议您通过上下文参数注入密钥,或者创建一个管理页面n,您可以输入关键。

I'd advise you to either inject the key via context parameters, or create an admin page n which you can enter the key.

这篇关于将war文件转换为可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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