Found the solution for my problem.
Because my code is a Servlet filter, this does the trick:
public void doFilter(ServletRequest req, ... ){
String cp = ((HttpServletRequest)req).getContextPath();
...
}
-Max
On 05/11/2012 01:45 PM, Max Spring wrote:
How can I get a hold of the "prefix" value when running Jenkins behind Apache
[1]?
While it's set as a property, System.getProperty("prefix") doesn't yield a
value.
Jenkins.getRootUrl() also doesn't return the prefixed URL.
Trying to fix a bug in my plugin [2].
Thanks!
-Max
[1] https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache
[2] https://issues.jenkins-ci.org/browse/JENKINS-12224