20080412 java HTTP server
http://www.yippeesoft.com
http://users.skynet.be/pascalbotte/rcx-ws-doc/xmlpost.htm
1.5. Java HTTP post for XML SOAP message.
http://www.devdaily.com/java/jwarehouse/jakarta-tomcat-3.3.2-src/src/share/org/apache/tomcat/util/test/HttpRequest.java.shtml
This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example"
http://docs.huihoo.com/java/se/jdk6/docs/guide/net/httpserver/spec/com/sun/net/httpserver/Headers.html#size()
com.sun.net.httpserver
Class Headers
http://docs.huihoo.com/java/se/jdk6/docs/guide/net/httpserver/spec/com/sun/net/httpserver/HttpExchange.html
com.sun.net.httpserver
Class HttpExchange
http://blogs.sun.com/sandoz/
Jersey Client API
import java.io.IOException;
import java.net.InetSocketAddress;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
public class Test &leftsign;
public static void main(String[] args) throws IOException &leftsign;
HttpServer httpServer;
httpServer = HttpServer.create(new InetSocketAddress(81), 5);
httpServer.createContext("/", new Handler());
httpServer.start();
&rightsign;
static class Handler implements HttpHandler &leftsign;
public void handle(HttpExchange exchange) throws IOException &leftsign;
Headers requestHeaders = exchange.getRequestHeaders();
Headers responseHeaders = exchange.getResponseHeaders();
responseHeaders.set("Content-Type", "text/plain");
exchange.sendResponseHeaders(200, 0L);
OutputStream responseBody = new BufferedOutputStream(exchange.getResponseBody(), 64*1024);
responseBody.write("Hello!".getBytes());
responseBody.close();
exchange.close();
&rightsign;
&rightsign;
&rightsign;
http://excalibur.apache.org/download.cgi
http://httpdbase4j.berlios.de/
HttpdBase4J is an embeddable Java web server framework that supports HTTP, HTTPS, templated content and serving content from inside an archive. The classes are easy to extend as they utilize the Hollywood \’don\’t call us, we\’ll call you\’ principle to allow the user to overide the framework behaviour during all the different phases of the HTTP transaction. Note:HttpdBase4J uses the Java 6 com.sun.net.httpserver classes so it won\’t currently work under earlier versions of Java.
HttpdBase4J是一个可嵌入的java web服务器架构,支持http , https协议,模板内容等.实现的类都易于继承,无论在http传输的哪个阶段,开发者可自由重写其框架行为.
http://www.jguru.com/forums/view.jsp?EID=1333689
How to server HTML in Java6 com.sun.net.httpserver?
最近在研究Http Server,在google上搜索到 com.sun.net.HttpServer package
http://excalibur.apache.org/download.cgi
excalibur-instrument包中也有你需要的方法,这里是Apache的开源项目,而你找到的是sun公司的一个项目
如下是API页面http://excalibur.apache.org/apidocs/org/apache/excalibur/instrument/manager/http/server/HTTPServer.html
http://cindy.sourceforge.net/
Cindy is a robust, scalable and efficient asynchronous I/O framework, supports TCP, SSL over TCP, UDP and Pipe. It\’s released under the Apache 2.0 License.
indy 3.0b1 released
下载地址:http://cindy.sourceforge.net
修改记录:
* 添加了hello world示例
* 添加了简单的tcp/ip服务示例(echo/discard/daytime/chargen)
* 添加了telnet示例(tcp/udp)
* 更新了http server示例,支持列表目录
* 为DefaultPacket添加了两种构造函数:DefaultPacket(ByteBuffer)/DefaultPacket(byte[])
* 添加了SessionType类,并为Session/SessionAcceptor接口添加了getSessionType方法返回Session类型
* 为Configuration类添加了set方法
* 在SessionFactory类中加入了createSession(SessionType)和 createSessionAcceptor(SessionType)两个方法,原来的 createSocketSession/createDatagramSession/createSocketSessionAcceptor方法被 deprecated
* 修正DirectDispatcher.block中的bug,原实现在判断是否为核心线程方面存在Bug
http://www.mortbay.org/
Jetty is an open-source, standards-based, full-featured web server implemented entirely in Java. It is released under the Apache 2.0 licence and is therefore free for commercial use and distribution. First created in 1995, Jetty has benefitted from input from a vast user community and consistent and focused development by a stable core of lead developers. There are many more examples of Jetty in action on the Jetty Powered Page that has selections from among the tens of thousands of production Jetty instances. However, as Jetty aims to be as unobtrusive as possible, countless websites and products are based around Jetty, but Jetty is invisible!
Full commercial support, training and development services for Jetty and Jetty-based projects are available from Webtide .
http://www.onjava.com/pub/a/onjava/2003/04/23/java_webserver.html
How Java Web Servers Work
http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html
Package com.sun.net.httpserver
Mina、Cindy和QuickServer
http://dev.csdn.net/author/calvinxiu/e28cd84b9ddc4e88a34afce45eed8f68.html
QuickServer–在吵闹的环境里快速搭建自己的TcpServer(Pragmatic系列)
http://www.blogdriver.com/zeroliu/1242606.html
循证架构:QuickServer/Cindy/Mina- -
http://blog.csdn.net/numenZQ/archive/2007/05/22/1621482.aspx
项目组织的最佳实践
设置文件夹结构并按照类型划分数据库对象。
http://blog.csdn.net/zhangliulin/archive/2007/10/16/1826707.aspx
设计一个美好的服务器–MINA、CXF、Mule、JBoss/Geronimo
http://blog.csdn.net/zhangliulin/archive/2007/10/16/1826710.aspx
轻的,谁都会写的Service方案–REST与JSON
最近研究了Java 通讯框架,感觉很不错,由于NETTY2的停止开发,Netty2的作者转而开发了MINA这个Framework,到是也不错,不过我建议有工夫的话,各位不妨也看看咱们国产的Cindy ,呵呵,这可不是抵制日货才说的,这个Framework 到还不错,推荐给大家啊,实在没时间写 Cindy ,Jive Messenger 的相关资料,各位自己有空去研究一下吧,且作者最近的Cindy2.4我开也不错,下面有他的BLOG连接,自己去看吧!
Cindy blog : http://spaces.msn.com/members/crmky/
Java Eye Cindy : http://www.javaeye.com/viewtopic.php?t=11185&start=15
SourceForge : http://sourceforge.net/projects/cindy/
Cindy:http://cindy.sourceforge.net
Netty2:http://gleamynode.net/dev/
MINA:http://www.apache.org/~trustin/mina-20050207/index.html
http://www.javaeye.com/topic/33992
NIO框架Cindy中HTTP范例的一个BUG及修改
http://svn.apache.org/viewvc/mina/branches/1.0/example/src/main/java/org/apache/mina/example/httpserver/codec/
/mina/branches/1.0/example/src/main/java/org/apache/mina/example/httpserver/codec
http://docs.safehaus.org/display/ASYNCWEB/Home
AsyncWeb is a high-throughput, non blocking Java HTTP engine – designed throughout to support asynchronous request processing
http://mina.apache.org/documentation.html
Apache MINA – The High Performance Protocol Construction Toolkit (ApacheCon US 2007)
Can MINA handle text protocols such as HTTP?
Yes. Please take a look at the Reversed and HTTP server examples. AsyncWeb is a HTTP server implementation based on MINA.
http://hi.baidu.com/jabber/
* Java中目前有2种选择,一种是基于Apache MINA框架的,稍复杂但适合用在大场合;一种是基于Java Web容器自己提供的支持,如Jetty和Tomcat,适合comet只是应用中一小部分场合。
* Mina只是个网络层(相当socket层)的框架,如果用mina需要自己实现HTTP协议。好消息是这个工作已经有开源做了,一个叫Asyncweb项目在mina的基础上实现了HTTP协议层的封装。而且asyncweb正在被mina合并,将加入到mina的发行版中。
用asyncweb编程很简单,只需实现一个接口,实际上只需要实现 handleRequest, 在 request 返回结果。
public interface HttpService
&leftsign;
void handleRequest( HttpServiceContext context ) throws Exception;
void start();
void stop();
&rightsign;
AsyncWeb是一个高性能,非阻塞(non-blocking ),可内嵌在应用程序中使用的Java HTTP引擎。它始终围绕支持异步请求处理而设计。AsyncWeb还能与Spring框架集成。
http://www.blogjava.net/hengheng123456789/archive/2007/09/03/142325.html
MINA Beginning
http://hi.baidu.com/zeorliu/blog/item/80d2b26e3b3e10de80cb4a62.html
使用Apache-MINA开发高性能网络应用程序(转)
http://www.w3.org/Jigsaw/User/api/w3c.www.http.HttpRequestMessage.html
Class w3c.www.http.HttpRequestMessage
NanoHTTPD
A free, simple, tiny (1 java file!), nicely embeddable HTTP server in Java.
Getting the software:
nanohttpd is currently a pre-alpha software. This means that no stable version is available. Thus, to make sure you get the freshest version, you should use CVS:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nanohttpd login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nanohttpd co nanohttpd
http://nanohttpd.sourceforge.net/example.html
The Fizmez Web Server is a small Web server written in Java. Its source code can serve as a useful learning tool for those who wish to learn about Java server sockets.
http://freshmeat.net/projects/fizmezwebserver/
http://javenstudio.org/blog/?page_id=25
SOCKET的封装(Java中Socket类的C++实现)
http://blog.csdn.net/jackfor001/archive/2007/12/14/1936594.aspx
Mina 应用开发—新手入门
pygmy
最近做得p2p项目要用到pygmy这个微型http server。pygmy的用法非常简单,首先是一份properties文件,可以是这个样子:
https://sourceforge.net/project/showfiles.php?group_id=87807
Pygmy is a 40KB portable http stack written in Java. It is ideal for PDA and resource limited devices, as well as desktop applications and server applications. Pygmy provides a plug-in architecture so features can be added and removed easily.
http://www.open-open.com/30.htm
http://cucme.blog.163.com/blog/static/6804543200792411039843/
java代码框架示例……socket通信(server)
http://hi.baidu.com/ofbase/blog/item/29fe2e24f2c8e72ad50742de.html
Apache MINA 线程模型配置
http://www.zeali.net/entry/70
Http协议客户端的JAVA简单实现
http://dev.csdn.net/article/7/7991.shtm
用Java实现Web服务器
http://tech.163.com/tm/030531/030531_95888.html
实战Java Web服务器--使用HTTP协议和JAVA类实现
历史博文
- SQLite SubSonic - 2010
- 20070803 PHP5 IIS NTFS - 2008
- 0724 vc 进程 自定义 消息 WM_COPYDATA - 2007
- 1223 feedburner 书生商友 107P 飞利浦 107P5 黑屏 - 2006