The following case doesn't seem to get processed by the JSP engine --
(the actual function of the tag doesn't really matter - it's a simple
custum tag extension that just prints out an encoded URL based on an
attribute)

<SCRIPT LANGUAGE="JavaScript">
<!--
js_variable = "<mytag:encode url="myfile.html"/>";
// -->
</SCRIPT>

This just passes the tag right through to the output.

If I remove the HTML comments "<!--" and "// -->" then it is processed
ok.

I was trying to figure out whether this is the expected behavior or a
bug, and looking at the JSP 1.1 Spec section 2.3 (Comments) it looks
like this should be processed:

"If the generated comment is to have dynamic data, this can be obtained
through an expression syntax, as in:
<!-- comments <%= expression %> more comments ... --> "

This is not exactly the same as using a custom tag (which isn't
addressed), but since there is specifically a JSP "<%--" & "--%>" syntax
for comments that JSP ignores, it seems like the intent was that JSP
processing does not pay any attention to HTML comments (ie. just treat
them like any other normal text).

Does this interpretation make sense?

Jake

Reply via email to