prop.YUI.OmitFilesFromMinificationRegEx = .*\\.min\\.(js|css)$
combinatorius.properties
. Request = Request-Line *(( general-header | request-header | entity-header ) CRLF) CRLF [ message-body ]
GET /Protocols/rfc2616/rfc2616-sec5.html HTTP/1.1 Host: www.w3.org Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36 HTTPS: 1 Referer: https://www.google.ie/ Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 Cookie: _ga=GA1.2.587820689.1448903370; JSESSIONID=00002Fn37WPDiDzeIspqmDaEY1J:-1; web_vid=1140991966240108
Response = Status-Line *(( general-header | response-header | entity-header ) CRLF) CRLF [ message-body ]
HTTP/1.1 200 OK Date: Tue, 12 Apr 2016 15:56:01 GMT Last-Modified: Thu, 18 Feb 2016 10:16:05 GMT ETag: "19982-52c08a77e8340" Accept-Ranges: bytes Content-Length: 104834 Keep-Alive: timeout=10, max=100 Connection: Keep-Alive Content-Type: text/css X-Pad: avoid browser bug
Cache-Control: public, s-maxage=31536000, max-age=31536000
combinatorius.properties
. Expires: Thu, 15 Apr 2017 22:00:00 GMT
combinatorius.properties
. <dependency> <groupId>com.dkiriusin</groupId> <artifactId>combinatorius</artifactId> <version>1.0.60</version> </dependency> <dependency> <groupId>com.yahoo.platform.yui</groupId> <artifactId>yuicompressor</artifactId> <version>2.4.8</version> </dependency>
web.xml
. <servlet> <servlet-name>Combinatorius</servlet-name> <servlet-class>com.dkiriusin.combinatorius.CombinatoriusServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Combinatorius</servlet-name> <url-pattern>/combo/*</url-pattern> </servlet-mapping>
/combo/*
will be processed by the library.combinatorius.properties
and place it in the Classpath.common.loader
in catalina.properties
and adding the path to combinatorius.properties
. In my case (Ubuntu 12.04 LTS): view /etc/tomcat7/catalina.properties
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/var/lib/tomcat7/common/classes,/var/lib/tomcat7/common/*.jar
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/var/lib/tomcat7/common/classes,/var/lib/tomcat7/common/*.jar,${catalina.base}/combinatorius-conf
mkdir /var/lib/tomcat7/combinatorius-conf
combinatorius.properties.
into it combinatorius.properties.
#---------------------# # required properties # #---------------------# # root CSS directory prop.css.dir = /var/lib/tomcat7/webapps/my_project/css # cached CSS directory prop.css.cache.dir = /var/lib/tomcat7/webapps/my_project/css_cache # root JS directory prop.js.dir = /var/lib/tomcat7/webapps/my_project/js # cached JS directory prop.js.cache.dir = /var/lib/tomcat7/webapps/my_project/js_cache #---------------------# # optional properties # #---------------------# # themes root directory prop.themes.dir = /var/lib/tomcat7/webapps/my_project/themes # Cache-Control: s-maxage directive (31536000 by default) prop.s-maxage = 31536000 # Cache-Control: max-age directive (31536000 by default) prop.max-age = 31536000 # Enables gzip compression (true by default) prop.isCompressionEnabled = true # Enables YUI compressor (true by default) prop.isYUICompressorEnabled = true # Insert line breaks in output after the specified column number (-1 by default) prop.YUI.CSSCompressor.linebreakpos = -1 # Splits long lines after a specific column (100 by default) prop.YUI.JavaScriptCompressor.linebreak = 100 # Minify only, do not obfuscate (false by default) prop.YUI.JavaScriptCompressor.nomunge = false # verbose output (false by default) prop.YUI.JavaScriptCompressor.verbose = false # Preserve unnecessary semicolons (such as right before a '}') (false by default) prop.YUI.JavaScriptCompressor.preserveAllSemiColons = true # Disable all the built-in micro optimizations (true by default) prop.YUI.JavaScriptCompressor.disableOptimisations = true # Define files to be omitted of minification ('.*\.min\.(js|css)$' by default) prop.YUI.OmitFilesFromMinificationRegEx = .*\.min\.(js|css)$
prop.css.dir
and prop.js.dir
directories, as well as their sub-directories. CSS and JavaScript files are recursively read in alphabetical order, minimized, compressed and sent to the client. Minimized data is cached on the server side in the prop.css.cache.dir
and prop.js.cache.dir
.prop.YUI.OmitFilesFromMinificationRegEx
not minimized.prop.themes.dir
sub-directory with one or more CSS files. For example prop.themes.dir/green/theme.css
. The theme name must match the sub-directory name and can be transferred to the library as a theme
parameter URL or as the value of combinatorius.theme
in Cookies.prop.css.dir
and prop.js.dir
. Such a need may arise if the script is rarely used (on one or two pages in a project) and should not be included in the “assembly” by default. You can transfer additional resources using the resources
parameter URL. /combinatorius/combo/&type=js&resources=extra_js/extra1.js,extra_js/extra2.js&theme=blue
type
and path
. <%@ taglib uri="https://github.com/deniskiriusin/combinatorius" prefix="cb" %> <cb:combo type="css" path="/combo"> <jsp:attribute name="theme">blue</jsp:attribute> <jsp:attribute name="csv_resources">extra_css/extra1.css,extra_css/extra2.css</jsp:attribute> </cb:combo> <cb:combo type="js" path="${path}"></cb:combo>
/combinatorius/combo/&type=js&v=1465737376000
Source: https://habr.com/ru/post/303840/
All Articles