Results 1 to 2 of 2
- 03-01-2011, 12:36 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 8
- Rep Power
- 0
How to serv HTTP/1.1 404 Not Found from socket?
hello, my app is listening for a http request, when it gets it, what ever it is i want to display a 404 Not Found in the client browser.
When i tellnet my srver it return "HTTP/1.1 404 Not Found" but if i do it from a browser it just loads for a verry long time.
Do i need to send more code, or many close the socket after i sen the HTTP/1.1 404 msg? this the the response code.
//ThansJava Code:while (true) { Socket client = serverSocket.accept(); DataOutputStream output = new DataOutputStream(client.getOutputStream()); String line = null; //len = strlen("HTTP/1.1 404 Not Found\n"); line = "HTTP/1.1 404 Not Found\n"; output.writeBytes(line); }
- 03-01-2011, 03:06 PM #2
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
A4J is not found
By aali-01 in forum Web FrameworksReplies: 0Last Post: 02-17-2011, 05:53 AM -
Socket and how to launch thread for receiving socket messages
By newbiejava in forum New To JavaReplies: 1Last Post: 07-02-2010, 01:18 PM -
HTTP Status 405 - HTTP method GET is not supported by this URL
By javanewbie in forum Java ServletReplies: 7Last Post: 11-11-2009, 08:29 PM -
append response to the request from Socket and write to another socket
By vaibhav_singh_vs@yahoo.co in forum NetworkingReplies: 3Last Post: 04-17-2009, 07:02 PM -
Http change to HTTP\SSL
By ballyv24 in forum Advanced JavaReplies: 0Last Post: 05-14-2008, 11:32 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks