Tuesday, April 3rd, 2007

pack:tag: Compressing JSP Taglib

Category: Java, JavaScript, Library

pack:tag is a static-resource compressing JSP-Taglib. It caches ad hoc compressed JavaScript or CSS in memory (in a Java Servlet) or in a generated file. It works transparently to the developer and the compressing-algorithms are pluggable.


  • Minification of JavaScript and Cascading Style Sheets
  • Caching to filesystem or memory (servlet)
  • When caching to memory, the minified content is additional gzipped
  • Apache Standard Taglib support for evaluations
  • Compression and hashcode-generation adjustable on single resources


You would use JSP tags such as the following in your JSP files:

  1. <pack :script src="myJavaScriptFile.js"/>
  2. <pack :style src="myCascadingStyleSheet.css"/>
  3. <pack :script src="myJavaScriptFile.js" enabled="false"/>

Posted by Dion Almaer at 8:26 am
1 Comment

4.3 rating from 38 votes

1 Comment »

Comments feed TrackBack URI

I have tried to implement this in our project,But itz not loading the scripts.Im able to see the script tag generated in JSP(viewsource->h982….js).Any body have any idea,Where this packer will store js files which have been compressed.Do i need to do any thing else to make it work.
Thanks in advance.

Comment by Srinivasa Reddy — October 30, 2007

Leave a comment

You must be logged in to post a comment.