Вопрос

I'm using this taglib on one of my projects. https://github.com/JonathanWalsh/Granule

For now it seems good, but I wanted to make something like:

<granule:compress option="${param.disableCompression}" path="contextPath">
    <link rel="stylesheet" href="/resources/bootstrap/css/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="/resources/jquery.ui.all.css" type="text/css" />
    <link rel="stylesheet" href="/resources/jquery.ui.theme.css" type="text/css" />
    <link rel="stylesheet" href="/resources/style.css" type="text/css" />
</granule:compress>

The objective is to pass a disabledCompression=true parameter on the url, and disable the compression when needed to solve some problem. Independent of environment. But still adding the contextPath to it.

Anyone have worked with this taglib? Or some similar library that could help?

Это было полезно?

Решение

Well,

I made my own tag that accepts this parameter. Something like this.

< c:choose>

   <c:when test="${param.ignoreCompress eq 'true'}">
    <jsp:doBody/>
   </c:when>
   <c:otherwise>
    <jsp:doBody var="body" />
    <granule:compress method="${param.ignoreCompress eq 'true' ? 'none':'closure'}" >
        ${body}
    </granule:compress>
 </c:otherwise>
</c:choose>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top