On 27 October 2013 16:09, Niki Dokovski <nick...@gmail.com> wrote:

> On Sun, Oct 27, 2013 at 4:46 PM, Neil Martin <nsm...@gmail.com> wrote:
>
> > Thanks for the replies Mark.
> >
> > It does seem to me that most developers using websockets under tomcat are
> > going to want that integration with the J2EE container.  Maybe I'm wrong,
> > but it seems like the plumbing to make the servlet context available to
> the
> > EndpoingConfig will be messy because the websockets framework has been
> > designed to be divorced from its environment.
> >
> > From this perspective, the tomcat 7 websockets implementation seems
> easier
> > to work with; at least for developers who are looking to use websocket
> > endpoints as a replacement for servlets.  Does this make sense?
> >
>
> Perhaps, such request can be posted on EG mail list [1] or JIRA  issue
> tracker [2]
>
> [1] jsr356-expe...@websocket-spec.java.net
> [2] http://java.net/jira/browse/WEBSOCKET_SPEC



I guess what would be nice is that an end point just needs to implement 1
interface "IContextAware" that has one method:
"setServletContext(ServletContext)"
that is then called by the container at the moment the endpoint does
implement that interface..

 Now i guess the only way to get it through the http session that is gotten
through the ServerEndpoint:
http://stackoverflow.com/questions/17936440/accessing-httpsession-from-httpservletrequest-in-a-web-socket-socketendpoint

But is there always directly a HttpSession? Because if that is not the case
(i only hit the server with the ws:// url) then i can't get to the context
at all.

johan

Reply via email to