This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

Sockets in Servlets/JSP

Thomas Dev

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
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.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60782

Thomas, please do not cross-post the same question in multiple forums. Please continue this discussion in the Servlets forum.
Additionally, there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
JSP Forum Bartender

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Sockets in Servlets/JSP
Similar Threads
MIDP and Connection Not Found Exception:
--Sockets in Servlets/JSP
Socket Connection Not Working With Java Desktop Application
Connection reset by peer: socket write error