Using custom tag output as a JavaScript
string when the tag's output spans multiple lines is probably not very practical, since JavaScript doesn't support herestrings/multi-line strings without using a line continuation character.
You're probably better off using hidden divs and toggling between them based on your existing
test (if you need to allow both on the same page without a refresh) or doing to comparison during page load if you don't.
Technically this probably isn't a
Struts question, but a JavaScript question.