Khoda
Khoda

Reputation: 953

How to strip the comments off the jsp view?

I need a mechanism that remove my comments from view, something like a filter in web.xml. It is better if this filter works on every files(e.g. javascript,css, ...) not only JSPs. comment sample in JSP file :

<script>
    //var time = null;
</script>

Upvotes: 0

Views: 399

Answers (1)

Vikas Sharma
Vikas Sharma

Reputation: 755

Use JtidyFilter by setting hide-comments to true.This will strip HTML comments out of a page generated with JSP/JSTL.

http://jtidy.sourceforge.net/multiproject/jtidyservlet/filter.html

<init-param>
    <param-name>config</param-name>
    <param-value>hide-comments: true</param-value>
</init-param>

Upvotes: 1

Related Questions