Index: lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java =================================================================== diff -u -rfdd35edfede5d68fc8e6d910495e9dd88e5d6db2 -r7a60d8fcd6a098e559c013097085165deb5d2d98 --- lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java (.../HelpTag.java) (revision fdd35edfede5d68fc8e6d910495e9dd88e5d6db2) +++ lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java (.../HelpTag.java) (revision 7a60d8fcd6a098e559c013097085165deb5d2d98) @@ -86,7 +86,13 @@ } try { - if(toolSignature != null && module != null) { + Locale locale = (Locale) session.getAttribute(LocaleFilter.PREFERRED_LOCALE_KEY); + if ( locale != null ) { + language = locale.getLanguage(); + country = locale.getCountry(); + } + + if(toolSignature != null && module != null) { // retrieve help URL for tool ILamsToolService toolService = (ILamsToolService) getContext().getBean(AuthoringConstants.TOOL_SERVICE_BEAN_NAME); IToolVO tool = toolService.getToolBySignature(toolSignature); @@ -97,35 +103,27 @@ return SKIP_BODY; // construct link - - Locale locale = (Locale) session.getAttribute(LocaleFilter.PREFERRED_LOCALE_KEY); - if ( locale != null ) { - language = locale.getLanguage(); - country = locale.getCountry(); - } - fullURL = helpURL + module + "#" + toolSignature + module + "-" + language + country; - // TODO Added to debug Chinese problem. To be removed. - if ( log.isDebugEnabled() ) { - log.debug("In help tag, url is "+fullURL); - } - writer.println(""); - + + } else if(page != null){ - writer.println(""); + + String anchorPrefix = page.replaceAll("[+\\s]", ""); + + fullURL = Configuration.get(ConfigurationKeys.HELP_URL) +page+ "#" +anchorPrefix+ "-" + language + country; + + writer.println(""); + } else { log.error("HelpTag unable to write out due to unspecified values."); writer.println(""); - } } catch (NullPointerException npe) { log.error("HelpTag unable to write out due to NullPointerException. Most likely a required paramater was unspecified or incorrect.", npe); // don't throw a JSPException as we want the system to still function. - - writer.println(""); - + } writer.println("");