Bookmark Topic Watch Topic
  • New Topic

Sockets in Servlets/JSP  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
Author and ninkuma
Posts: 66424
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!