Meaningless Drivel is fun!*
The moose likes JSP and the fly likes JSP Pages and CVS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Pages and CVS" Watch "JSP Pages and CVS" New topic
Author

JSP Pages and CVS

O. Ziggy
Ranch Hand

Joined: Oct 02, 2005
Posts: 430


Hi,

I have a lot of jsp files in CVS that are not compilable files. (e.g. *.html, *.jsp etc).
I use the following template on each new file that is checked in to cvs.




This means that whenever a file is update or modified and then checked in, a log is appended to the cvs history section of the jsp page at the top of the page . Here is an example



Now this is working very well. The only problem is that with pages that are not compilable, the revision history is also visible. For example on JSP pages, the cvs history is included in each page as html comments. So on the browser, if someone selects "View Source", they can view the source of the html/jsp page and the revision history of the page.

Is there a way to remove the revision history before deployment? I know i can use some unix tools like grep and cut to remove the revision history but i have a feeling it wont be a simple job to determine whether its a real comment or a cvs history comment. Is there an easier way to do this?

Thanks

its fine with compilable files e.g. (.java, .c etc) as these are not visible to the user as they run on the server side.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

They're not visible because they're in comments, not because it's run on the server side.

JSPs, by the way, *are* compilable, and you can put the CVS comments in JSP comments as well. HTML, not so much; there are any number of ways to remove them including CVS hooks, deployment/build filtering, and so on. Depending on how they're being added (for instance, by looking for placeholders on checkin) you might just be able to remove the placeholder and it will no longer be added--so you'd do that for the HTML files.

All that said, I wouldn't bother putting that information in the files at all: it's noisy, doesn't provide any information you can't already get, putting the information in only *some* file types defeats the purpose, and is a relic of an earlier time.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

I concur with David. I've been working with JSPs for over 10 years and have never kept that kind of information in them.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Pages and CVS
 
Similar Threads
Eclipse setup question
What are the best practices on mainline (trunk) code management?
CVS Comments added to Code
CVS Change Logs
IBM Exam 157 - Questions and Answers (Sample Exam)