java ee - How can I get real system file path from within a WebSocket Endpoint -
while within servlet context can real system file path calling on request.getservletcontext().getrealpath(upload_path). please friends how can equivalent within websocket endpoint in java ee 7. in advance.
you can path information serverendpointconfig#getpath(). difference between results of method , servletcontext#getrealpath()
gives relateive path; prefix results of method root context name. results, need implement onopen
(from javax.websocket.endpoint
class)
//called when client first negotiates opening of websocket connection public void onopen(session session, serverendpointconfig config){ string path = config.getpath(); }
Comments
Post a Comment