LPS-47370 move logic to the backend (no logic changes)
LPS-47370 Fix bug - each end.jsp sets its own attributes instead of trusting the ones in the request (which are removed by the child tabs)
LPS-47370 remove duplicated logic (it was already duplicated in the jsp!) and reorder all the logic alphabetically so that it is clearer
LPS-47370 show the newly created var is only used in that one spot
LPS-47370 Simplify