简体   繁体   English

客户端和服务器端应用程序之间的通信

[英]communication between client side and server side application

I am working on a project of DBpedia entity summarization. 我正在研究DBpedia实体摘要的项目。 I want first to turn a project API called SUMMARUM. 我想首先打开名为SUMMARUM的项目API。 In this project the author make two parts: a client part and server application part: 在这个项目中,作者分为两部分:客户端部分和服务器应用程序部分:

Server side: https://github.com/athalhammer/summaServer 服务器端: https//github.com/athalhammer/summaServer
Client side: https://github.com/athalhammer/summaClient 客户端: https//github.com/athalhammer/summaClient

Now, I am reading some tutorials about servlet which aim to develop a server application. 现在,我正在阅读一些有关servlet的教程,旨在开发服务器应用程序。 And from what I understand, a servlet life cycle can be defined from a set of functions: init() , service() , doGet() , doPost() , destroy() , ... and extends javax.servlet.http.HttpServlet . 根据我的理解,可以从一组函数定义servlet生命周期: init()service()doGet()doPost()destroy() ,...并扩展javax.servlet.http.HttpServlet

The problem now, is that I didn't find the above functions in the summaServer project and I don't understand how to make a connection between the server side and the client side. 现在的问题是,我没有在summaryServer项目中找到上述函数,我不明白如何在服务器端和客户端之间建立连接。

As Dmitry already answered, summaServer uses jax-rs where the endpoint doesn't have to extend javax.servlet.http.HttpServlet . 正如Dmitry已经回答的那样,summaServer使用jax-rs ,其中端点不必扩展javax.servlet.http.HttpServlet

What fooled you is that you can use use servlets as web service endpoints and the tutorials you read certainly do that. 欺骗你的是你可以使用servlet作为web服务端点,你读过的教程肯定会这样做。 I would say this is the old fashion way. 我会说这是旧时尚的方式。

Now, jax-rs and its annotation remove all the boilerplate you had to implement otherwise. 现在,jax-rs及其注释删除了你必须实现的所有样板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM