如何在没有Spring框架的Java EE应用程序中创建类似Spring Shell的CLI? [英] How to create a CLI like Spring Shell in Java EE application without spring framework?

查看:286
本文介绍了如何在没有Spring框架的Java EE应用程序中创建类似Spring Shell的CLI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用了Spring shell,效果非常好。

I used Spring shell in my project, which works very well.

现在我们在JBoss应用服务器上有一个Java EE项目。我希望有一个好的CLI,就像Spring shell一样。如何做到这一点?

Now we have a Java EE project on the JBoss application server. I would like to have a good CLI, just like the Spring shell. How can this be done?

推荐答案

据我了解你的要求,Spring Shell并不适用于此。 Spring Shell与利用JLine在实际终端中运行有些联系。可以编写另一个实现(类似于在IDE中运行方法),扫描MethodTargets并运行它们,从您的(自定义)webapp获取输入。

As far as I understand your request, Spring Shell is not meant for this. Spring Shell is somewhat tied to running in an actual terminal, leveraging JLine. Another implementation could be written (similar to the "running in IDE" approach) that scans for MethodTargets and runs them, taking input from your (custom) webapp.

可能< a href =http://www.crashub.org/ =nofollow> http://www.crashub.org/ 更适合您的要求。

这篇关于如何在没有Spring框架的Java EE应用程序中创建类似Spring Shell的CLI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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