Created
June 6, 2012 20:13
-
-
Save kohsuke/2884431 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String getActionUrl(String itUrl,Action action) { | |
| String urlName = action.getUrlName(); | |
| if(urlName==null) return null; // to avoid NPE and fail to render the whole page | |
| if(SCHEME.matcher(urlName).find()) | |
| return urlName; // absolute URL | |
| if(urlName.startsWith("/")) | |
| return joinPath(Stapler.getCurrentRequest().getContextPath(),urlName); | |
| else | |
| // relative URL name | |
| return urlName; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment