jsp函数标签替换' [英] jsp function tag to replace '
问题描述
这是我的代码,
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页面调用上面的css / index.jsp页面:
<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>
在我的项目中,有100个jsp页面返回css代码。为什么我这样做是为了将我的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.
在我的代码'中被替换为99999,但当我将99999更改为& ; #..;回归&放大器;#..;如何替换?
In my code ' is replaced with 99999, but when i change 99999 to & #.. ; return & amp;#..; how to replace?
如果有更好的选项来转换我的jsp使其成为html head部分中的css链接,请在此处发布。你也可以发表你的建议。
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.
推荐答案
现在我需要修改以获得更好的性能
now i need to modify for better performance
在将css上传到服务器之前,使用某种工具或者甚至使用一些简单的java程序修改css。
然后:
Modify the the css with some tool or maybe even with some simple java program before you upload it to the server. Then:
- 你不需要花时间解决这个问题
- 性能要好得多(每次请求的运行时都不需要替换)
这篇关于jsp函数标签替换'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!