Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

context path

 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know how can I access the context path (rooth path) of a web service?
I am looking for something equivalent to what you would do in a servlet: "getServletContext().getRealPath("/WEB-INF/xxxdirectory")".
Thanks,
Miki
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your only hope is probably proprietary features in your web services engine. Remember that not all SOAP messages are transmitted over HTTP...
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Koskela,
I think I was not clear enough. I want to retrieve the context path (root path) from the web service itself, where this is running (for e.g. for making use of the I/O file system for different resources allocation). So not from the client. In other word how can I read from/create files from the web service from a subdirectory of the WEB-INF for e.g.
I this is what you understood initially what does this have to do with SOAP messages transmitted over HTTP ?
Miki
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. I thought you meant context path as in "the concept defined in the Java Servlet specification", which means "http://host ort/myapp/mywebapp" etc...
Still, I believe there is no standard way of doing this.
 
Miki Muzsi
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I've ment the root path of the application (web service). However it feels very strange there is not way to retrieve that. It seems to me very basic. Otherwise I'll just put it in a property file and change it each time the aaplication is deployed in a different location. But this is what I wanted to avoid.
Ok, thanks anyway.
Miki
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic