I'm writing a Jenkins plugin. Right now, I need to get a index.jelly file to know its own URL (which includes a query string). I've tried the command
RP.getReferringURL()
but it seems that this doesn't work in Jenkins Jelly. Also, note that I want to do server-side processing of the url, so I need to get the URL from the jelly.
Relevant code:
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:test="/lib/hudson/test"
xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<script type="text/javascript">
${it.processURL(RP.getReferringURL())};
</script>
Thanks.
Finally found the answer on my own. Basically, instead of trying to do this using the jelly (which may or may not be possible), anything you want to do with the url on the java side of the plugin should be done using the Stapler class.
In this case, the command I wanted was:
Stapler.getCurrentRequest().getParameter(PARAMETER_NAME)