Questions tagged [com.sun.net.httpserver]

A Java class that provides a simple HTTP server framework.

A Java class that provides a simple HTTP server framework.

Persistent urban myth holds that it has been deprecated, but it hasn't. This appears to stem from the behaviour of some IDEs when encountering a com.sun.* package.

58 questions
0
votes
1 answer

Error message not going away in Netbeans, why? "java.net.BindException: Address already in use: bind"

It seems like a duplicate question of how to kill a process already running on that port, but it is a different question. When I killed the process and restart it, it still gives me that error message, seems like Netbeans has a problem, and the…
Frank
  • 30,590
  • 58
  • 161
  • 244
0
votes
0 answers

com.sun.net.httpserver doesn't work with org.apache.http.client

I make two requests from one client to the server and client hangs on second execute of method httpclient.execute(httpPost); if I create new client for each request everything is OK. If I make POST to google(for example) everything is OK. What's the…
0
votes
1 answer

How to fix java sun.net.Httpserver header already send error?

I implementing own tiny web server using sun.net.HttpServer... to enable css and javascript i wrote code using HttpHandler, but js directory having two files...it's working for one file, but when two files to transfer... error occurred.…
Kernel
  • 165
  • 4
  • 14
0
votes
0 answers

Save binary file from html form data with sun.net.httpserver

I am using sun.net.httpserver from JDK to create a simple http service for my device. Now I want to save the post form data in to a file, but I always found there are additional content saved in the file. root@android:/sdcard # cat…
Robin
  • 10,052
  • 6
  • 31
  • 52
0
votes
1 answer

Using com.sun.net.httpserver.HttpServer for comet/cometd

I would to use com.sun.net.httpserver.HttpServer to do comet/cometd. I am wondering how tough it is to do it so that I can take the waiting connections off the thread and into some waiting queue. Also, am I correct in that it looks like it is…
Paul
  • 316
  • 2
  • 12
0
votes
1 answer

Keeping a HttpServer alive

I am writing my first Java web server, using com.sun.net.httpserver. I am wondering if this bit of code is logical or necessary. Specifically, I am wondering if the server will stop at some point, and need to be manually restarted. /** * Starts…
Avalanche
  • 386
  • 2
  • 10
0
votes
1 answer

How to get the ssl session when using the sun HttpsServer

I am using the com.sun.net.httpserver.HttpsServer as Https Server and want to access the SSL session. I handle the requests in a HttpHandler. When using a plain SSLServerSocket i can access the client certificate etc. via the…
Nick Russler
  • 4,608
  • 6
  • 51
  • 88
0
votes
0 answers

Sun Java HttpServer - Either slow in serving requests or wasting resources (TIME_WAIT/CLOSE_WAIT)

First, I've searched a lot to find a solution but were not able to find an appropriate one. Environment (productive) Mongoose WebServer replies to simple GET-requests (all data are transmitted via QueryString) Apache HttpClient (single instance!)…
0
votes
1 answer

Fastest way to talk to server over WLAN from js/jQuery

I set up mini server using com.sun.net.httpserver as part of application which has ability to map files from hard disk and send them as response, just simple stuff for now (js, css, images, html). My requirement is to talk to server with little…
formatc
  • 4,261
  • 7
  • 43
  • 81
0
votes
1 answer

HttpExchange getRequestURI ends before the first ampersand "&"

The original URI is (let's say): http://xx.xx.xxx.xx:8000/mypath?parm1=1&parm2=he getRequestURI returns : http://xx.xx.xxx.xx:8000/mypath?parm1=1 It ignores the 2nd parameter. If I replace the & by comma(s), it returns the full URI with all the…
Joshua
  • 151
  • 1
  • 1
  • 9
0
votes
2 answers

How to handle failed authentications in Java HttpServer

I have implemented a small HTTP server in my Java program based on com.sun.net.httpserver.HttpServer, which also uses basic authentication. This all works fine, however, I want to handle any failed authentication requests. By default, when a user…
Matthias
  • 9,817
  • 14
  • 66
  • 125
0
votes
0 answers

Java HttpServer Basic Authentication problems

I have an implementation of Java's HttpServer that I use for testing its pretty basic and means I can adjust what is served up to the client on the fly. My code is using apache http client. I would like to test some authentication using this…
Alex Edwards
  • 1,613
  • 3
  • 24
  • 48
-3
votes
1 answer

put multiple byte[] into a single reponse body

I'm trying to send multiple files at onces in my Response body. My issue is that i was not able to concat multiples Array List into one that i'm later able to re seperate into multiple files. This is my code (that is not working) : …
Michel Melhem
  • 551
  • 1
  • 8
  • 22
1 2 3
4