You could simply make all your comments JSP code... that won't get
rendered to the browser.
I actually do this in all my JSPs... For instance, I might have a
Javascript function like this:
<% // Add two numbers %>
function add(a, b) {
<% // Add a + b and put it in c %>
c = a + b;
<% // Return the result %>
return c;
} <% // End add() %>
All the browser will get is:
function add(a, b) {
c = a + b;
return c;
}
All my comments are like that, whether they are comments of actual JSP
code, Javascript or HTML.
Alternatively, if you don't like that for some reason and really do want
to have your build script remove the comments, the <replaceregexp> task
should do the trick for you.
Frank
Tom Frantz wrote:
I want to be able to have comments in my code for JSP, HTML, JavaScript, ect., but I
don't want those comments to show up on the user's browser when they use "View
Source".
I recently found out (the hard way) that excessive use of comments ends up
slowing the response time for the pages. Our web and app servers are in
Pittsburgh but our users are in Ireland.
I want the comments to remain with the source code, but I want them removed
when I build and deploy the application.
We use Ant to build so I'm thinking there might be a way to do this using Ant
tasks.
Just wondering how others are handling something like this.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]