在不使用Web服务器的情况下部署Java Web服务 [英] Deploy java web service without using web server

查看:77
本文介绍了在不使用Web服务器的情况下部署Java Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以将自己创建的Web服务部署到任何PC上,而无需安装任何Web服务器应用程序,例如:tomcat?我想使其像任何PC上的代理/插件一样.为了访问Web服务,我只需要访问http://:8080/web_service.有什么建议吗?

It is possible to deploy my own created web service to any of PC without installing any web server app eg:tomcat? I want make it like agent/plug-in in any PC. In order to access the web services i only need to access http://:8080/web_service. Any suggestion about this?

推荐答案

比运行Jetty还要轻巧,您可以使用Java内置的HttpServer.

Even lighter than running Jetty you can use the HttpServer built into Java.

http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html

您需要编写自己的代码来解析请求数据,但这肯定是可行的.

You'll need to write your own code for parsing request data but it's certainly doable.

http://blogs.operationaldynamics.com/andrew/software/free-java/sun-secret-webserver.html

这篇关于在不使用Web服务器的情况下部署Java Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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