I've got a pretty simple code snippet that is really giving me some trouble. I've got a very simple method that hits the "URL" parameter and when there is a value it is returned. When it hits the "fragment" parameter it doesn't return anything and for the life of me can't figure out why I don't get any errors I simply get an empty string.
url = properties.get("url", "")
fragment = properties.get("fragment", "")
Page checkedPage = resource.resourceResolver.getResource(url).adaptTo(Page)
url = chatOverlay ? headerURL(checkedPage, url, fragment) : ""
private static String headerURL(Page checkedPage, String url, String fragment) {
url += (checkedPage) ? ".html" : ""
url += (fragment) ? "#$fragment" : ""
}
Any help is greatly appreciated. I'm a newb so code snippets are really helpful.