Jersey REST Server:如何添加监视器GUI

时间:2022-05-22 15:40:22

Hej everyone,

Current state of my Project: As part of a distributed framework I'm working on I use a REST. Its a simple implementation in Java using Jersey and runs on Tomcat. It consumes calls from lots of other web services and has no direct user-interaction (so far). However beeing a central part of the whole framework and a lot of the other developer have to see its internal status. So far I had a simple REST call returning the log file and some extra information from the service.

我的项目的当前状态:作为我正在研究的分布式框架的一部分,我使用REST。它是一个简单的Java实现,使用Jersey并在Tomcat上运行。它消耗来自许多其他Web服务的调用,并且没有直接的用户交互(到目前为止)。然而,整个框架的核心部分和许多其他开发人员必须看到其内部状态。到目前为止,我有一个简单的REST调用返回日志文件和服务中的一些额外信息。

My task: For demonstration reasons I need to make this interface a bit more graphic (maybe add some GUI functions later). Also I have to change it from pull based to push based. This pretty much means I cant do it as just another rest call anymore. //EDIT more details for the GUI: Currently the GUI only needs to be able to show some status pictures but it needs to update itself. It has to run in a browser. Later on some interactive parts might be needed (pushing buttons)

我的任务:出于演示的原因,我需要使这个界面更加图形化(可能稍后添加一些GUI功能)。此外,我必须将其从基于拉的更改为基于推送。这几乎意味着我不能再做另外一次休息。 //编辑GUI的更多细节:目前,GUI只需要能够显示一些状态图片,但需要自行更新。它必须在浏览器中运行。稍后可能需要一些交互式部件(按下按钮)

Question: Is there a simple and easy to integrate tool/framework that would allow me to create a simple GUI (allowing for server push)? At the moment I,m looking at Vaadin but im not sure if thats not overkill. Also I dint get it to work alongside the other code so far.

问题:是否有一个简单易用的集成工具/框架,可以创建一个简单的GUI(允许服务器推送)?目前我,我正在看Vaadin,但我不确定这是不是有点过分。此外,我还得到它与其他代码一起工作到目前为止。

Hope someone can help me on this. I'm an absolute noob with all that web-service stuff, so I need something as simple as possible.

希望有人可以帮助我。我是所有网络服务的绝对菜鸟,所以我需要尽可能简单的东西。

1 个解决方案

#1


0  

If you have to push information, then have other services register a callback-address and make a rest call to those. (Define an interface to be implemented by them!) That's how I satisfied the push requirement in a project and it was well accepted by the clients. It's quite foolproof.

如果你必须推送信息,那么让其他服务注册一个回调地址并对其进行休息调用。 (定义一个由它们实现的接口!)这就是我对项目中的推送要求的满意度,并且它得到了客户的好评。这是非常万无一失的。

I am not quite sure what you want about that GUI? Maybe deliver a HTML5-Page with websockets to push-update the data?

我不太确定你想要什么GUI?也许提供带有websockets的HTML5页面来推送更新数据?

#1


0  

If you have to push information, then have other services register a callback-address and make a rest call to those. (Define an interface to be implemented by them!) That's how I satisfied the push requirement in a project and it was well accepted by the clients. It's quite foolproof.

如果你必须推送信息,那么让其他服务注册一个回调地址并对其进行休息调用。 (定义一个由它们实现的接口!)这就是我对项目中的推送要求的满意度,并且它得到了客户的好评。这是非常万无一失的。

I am not quite sure what you want about that GUI? Maybe deliver a HTML5-Page with websockets to push-update the data?

我不太确定你想要什么GUI?也许提供带有websockets的HTML5页面来推送更新数据?