Home » Core Java » sun

sun

com.sun.net.httpserver.Filter Example

In this example we shall show you how to make use of Filter class, A Filter is mainly used for pre or post processing of the incoming requests such as: Examine or modify the request headers. Set attribute Objects in the exchange using setAttribute(String name, Object value), which other filters or the exchange handler can access. Invoke the next filter in the chain, ...

Read More »

com.sun.net.httpserver.HttpServer Example

In this example we shall show you how to make use of HttpServer class, This class implements a simple HTTP server where we can start an embedded HTTP server which is bound to an IP address and port number and listens for incoming TCP connections from clients on this address. To process the incoming requests, we have to implement one ...

Read More »