Here is my code,
css/index.jsp:
<%@include file="/WEB-INF/common/css/common.jsp" %>
<style type="text/css">
body{background: #ffffff url('<c:url value='/resources/images/logo/logo_small.png'/>') no-repeat scroll center center}
</style>
index.jsp page calls the above css/index.jsp page:
<c:set var="my_css">
<c:if test="${branch == 'sitemap'}">
<c:if test="${page == 'index'}">
<%@include file="/WEB-INF/common/css/sitemap_common.jsp" %>
<%@include file="/WEB-INF/common/css/index.jsp" %>
</c:if>
</c:if>
</c:set>
<c:set var="css" value='${fn:replace(fn:replace(fn:replace(my_css,"<style type=\\\"text/css\\\">", ""),"</style>", ""),"\'", "99999")}'/>
<compress:css enabled="true">
<c:out value='${css}'/>
</compress:css>
In my project there are 100's of jsp pages that return css code. Why i'm doing this is to place my css as a link tag in head section.
In my code ' is replaced with 99999, but when i change 99999 to & #.. ; return & amp;#..; how to replace?
If there is a better option to convert my jsp to make it as a css link in html head section, please post here. You please post your suggestions too.
Modify the the css with some tool or maybe even with some simple java program before you upload it to the server. Then: