> > and i have a follow up question about this, with a servlet or a filter > you > > can do: getServletContext() then you have access to the resources of the > > web application and stuff like that > > How is that possible in an websocket endpoint? > > The ServerEndpointConfig will have the modifyHandshake() method called > where you have access to elements of the request and response. You need > to copy any data you need at this point. >
i was not talking about (http)request or response objects. But purely the ServletContext to access stuff of the web app itself. > > If i want to load in a file that is in the current webapps WEB-INF dir > how > > do i do that? How do i get an url or inputstream (getResource() call) to > > that file? > > Calls via the class loader will continue to work. > > It's not a resource in the WEB-INF/classes or a resource in a jar file I am talking about a normal resource anywhere in a war file itself (thats not in jars/classes) So for example i just want to get the content of the index.html in the root of the myapp.war Or i want a special properties file that i have in the myapp.war/WEB-INF/my.properties in a filter or servlet: getServletContext().getResource("WEB-INF/my.properties"); what is the line of code in a web socket endpoint to do the same? It seems that it is impossible to get the context of the webapp the socket is in.. johan