It's not a secret anymore!
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
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: 63852

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Sockets in Servlets/JSP
jQuery in Action, 3rd edition