https://github.com/galan/packtag
A JSP Taglib for delivering minified, combined and gzip-compressed resources (JavaScript and CSS).
https://github.com/galan/packtag
compression css java javascript jsp-taglib minification minify taglib
Last synced: 9 months ago
JSON representation
A JSP Taglib for delivering minified, combined and gzip-compressed resources (JavaScript and CSS).
- Host: GitHub
- URL: https://github.com/galan/packtag
- Owner: galan
- License: apache-2.0
- Created: 2013-08-25T07:58:49.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T15:03:30.000Z (over 1 year ago)
- Last Synced: 2025-04-13T02:08:56.581Z (about 1 year ago)
- Topics: compression, css, java, javascript, jsp-taglib, minification, minify, taglib
- Language: Java
- Size: 26.7 MB
- Stars: 25
- Watchers: 7
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/galan/packtag)
[](https://maven-badges.herokuapp.com/maven-central/de.galan.packtag/packtag-core)
[](https://www.apache.org/licenses/LICENSE-2.0.html)
# pack:tag
A JSP Taglib for delivering minified, combined and gzip-compressed resources (JavaScript and CSS).
# Usage
To use the taglib in a JSP, you have to declare it first:
<%@ taglib uri="https://github.com/d8bitr/packtag" prefix="pack" %>
(You can still use the old uri 'http://packtag.sf.net' for backward compatibility)
Now you can easily pack JavaScript by using the following tag:
Accordingly for Cascading Style Sheets:
You can enable and disable each tag individually by setting the attribute enabled to false, e.g.:
You can combine resources simply by listing them up:
/js/myJavaScriptFile.js
/js/mySecondJavaScriptFile.js
That's it.
If you want to deepen your knowledge and learn about advanced techniques, I suggest reading "[pack:tag - a packed guide to website performance optimization](https://github.com/galan/packtag/raw/master/documentation/packtag%20-%20a%20packed%20guide%20to%20website%20performance%20optimization.pdf)".
# Integration
1. Add the maven dependency to your project:
de.galan.packtag
packtag-core
4.0.0
2. Copy the `` and `` from the [web.xml](https://github.com/galan/packtag/blob/master/packtag-testsite/src/main/webapp/WEB-INF/web.xml) into your
/WEB-INF/web.xml
# Note
pack:tag is still supported, and still encouraged to be used if it makes sense for your project. But, no further development beyond bug fixes is expected. pack:tag is over 8 years old, and has been stable since then. Thank you to the community for your support of this project over the last years.