Your question is unclear. Please describe clearly what you're trying to accomplish, and why you think sockets are necessary/desirable. Unless you're communicating with some outside source you didn't mention, sockets aren't usually part of Web applications, which use HTTP and/or Ajax rather than sockets.
Are you you thinking you need to eavesdrop on the the Web server's HTTP listener (usually on port 8080)? Unless you have a really unusual requirement, interfering with the server's listener is almost always a bad idea.
I am talking abot websockets introduced in Java 7.
Yes - you said that - and without providing ANY link or reference to WHAT documentation you are talking about that is 'unclear'.
You also just ignored what you were ask to do:
Please describe clearly what you're trying to accomplish, and why you think sockets are necessary/desirable.