aspose file tools*
The moose likes Servlets and the fly likes --Sockets in Servlets/JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "--Sockets in Servlets/JSP" Watch "--Sockets in Servlets/JSP" New topic
Author

--Sockets in Servlets/JSP

Thomas Dev
Greenhorn

Joined: Dec 15, 2003
Posts: 4
Can we do Socket Programming in Servlets or JSP?
OR can we call a class from Servlets/JSP that does
socket connection.
I have a class that does a socket connection and then
closes the socket when processing is done.
When I try to instantiate this class from JSP I get a
IllegalStateException: Response has already been commited
error.
Why am I getting this error? I havent even called any method
I get this error just by instantiating the class.
If I comment the socket part from the class then it works fine.
regards
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
Originally posted by Thomas Dev:
Can we do Socket Programming in Servlets or JSP?
OR can we call a class from Servlets/JSP that does
socket connection.
I have a class that does a socket connection and then
closes the socket when processing is done.
When I try to instantiate this class from JSP I get a
IllegalStateException: Response has already been commited
error.
Why am I getting this error? I havent even called any method
I get this error just by instantiating the class.
If I comment the socket part from the class then it works fine.
regards

Try to do the same in Servlet.
In jsp you dont know when its sending response. Try to see generated java file.


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: --Sockets in Servlets/JSP
 
Similar Threads
Connection reset by peer: socket write error
Reg: java.net.SocketException....
Sockets in Servlets/JSP
Socket Connection Not Working With Java Desktop Application
MIDP and Connection Not Found Exception: