LDEV-3971: Remove pointless synchronisation from Java methods. It would not work in multi-node environment anyway. Focus on DB transactions. General clean up and formatting.
LDEV-3698: Swapped use of Apache Commons StringEscapeUtils for Spring's HtmlUtils, so that the multibyte characters (eg emojis) are not wrecked when escaping.
LDEV-3688: Rechecking in as previous commit went into wrong JIRA. Converting NULL to 0 when no matching detail records are found - occurs when the user has completed the submit activity but didn't upload a file.
LDEV-3933: Fixing spurious submit screen that was appearing in the chat area, due to the base url being set for this page. Removed unneeded prototype reference.
LDEV-3933: The user/file lookup was failing when there were users but no files. Tweaked the SQL to convert the NULL (returned when there were no detail records) to 0.