I know some people use ANT to accomplish this, but I don't want to remove HTML comments from the actual jsp, I just want a way to strip them from output unless a users adds a parameter to the url to show the comments for debugging.
Here is HTMLCompressor lib that can be called either from code or as JSP tag to strip comments and more.