简体   繁体   English

我可以不使用任何第三方库来创建Web服务吗

[英]Can I create web services with out using any third party libraries

Can I create a web services only using J2SE/J2EE ie without using Third party libraries. 是否可以仅使用J2SE / J2EE创建Web服务,即不使用第三方库。 I have created Web services using one of the JAX-RS implementation, Jersey and Tomcat server, But not sure about is there a way to create web service without any 3rd party library. 我已经使用JAX-RS实现,Jersey和Tomcat服务器之一创建了Web服务,但是不确定是否有一种无需任何第三方库就可以创建Web服务的方法。 Can someone enlighten me in detail? 有人可以详细启发我吗?

Yes definitely you can create web services using Servlet Api without using 3rd party libraries . 是的,绝对可以使用Servlet Api创建Web服务,而无需使用第三方库。 But it will be tedious task for achieving small functionality . 但是,实现小功能将是一项繁琐的任务。

1)You have to take care of incoming/outgoing HTTP headers in your code . 1)您必须注意代码中传入/传出的HTTP标头。 which can be accomplished just by just giving right annotations by using libraries 只需使用库提供正确的批注即可完成

2)You have to take care of data format sent back. 2)您必须照顾回传的数据格式。 When you say you deliver json back to client you have to write code for josn formatting . 当您说将json传递回客户端时,您必须编写用于josn格式化的代码。 which formats your data . 格式化您的数据。 this can be eliminated when 3rd party libraries are used 使用第三方库时可以消除此问题

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

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