tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Balazuc" <denis.bala...@trader.com>
Subject Cannot use "//" comments in JSP code - clarifications ?
Date Mon, 22 Oct 2001 17:41:41 GMT
Hi all

I've read that bug report about comments in JSP files and don't really
understand - can someone clarify the issue for me ? thanks

I'm wondering what's wrong with "//", and what I might be doing wrong as I
myself use such comments within JSP files...
(those comments use to work well...it's even better than using HTML comments
in a JSP file as they won't appear in the generated HTML)

Actually, I don't understand the argument "You should not be using "//"
comments"

--"//" are part of the java language spec
-- the JSP API is made for implementing server-side pages using the java
language

Therefore, JSP pages should accept everything that it's in the Java specs,
including "//".
If such comments are misplaced and the compilation fails, Tomcat is not
supposed to do anything..

So what's the real issue then ?

> ------- Additional Comments From craig.mcclanahan@sun.com  2001-10-22
10:11 -------
> You should not be using "//" comments.  You have absolutely no control
over the
> Java code that is generated for your page, so it is your responsibility to
use
> well-formed constructs.  In this particular case, that means to use /* */
style
> comment markers so that you can explicitly close them.  Even if we changed
> Tomcat to do what you suggest, depending on this would not be portable and
you'd
> have massive problems as soon as you tried to switch to some other
container
> that didn't do it.
>
> Using scriptlets at all can lead you into lots of other problems (such as
> intermixing business logic and presentation logic that makes it very hard
to
> maintain and enhance your applications), but that is a whole separate
> discussion.


Mime
View raw message