Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSP包含-删除空白/新行_Jsp_Jsp Tags_Sitemesh - Fatal编程技术网

JSP包含-删除空白/新行

JSP包含-删除空白/新行,jsp,jsp-tags,sitemesh,Jsp,Jsp Tags,Sitemesh,我试图将HTML缩小为一行。现在我使用的是Sitemesh 3过滤器和Htmlcompressor taglib,但问题是,当我导入CSS文件时,每个文件都以新行结尾,所以我的HTML不在一行中 <%@ page trimDirectiveWhitespaces="true" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://htmlco

我试图将HTML缩小为一行。现在我使用的是Sitemesh 3过滤器和Htmlcompressor taglib,但问题是,当我导入CSS文件时,每个文件都以新行结尾,所以我的HTML不在一行中

<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://htmlcompressor.googlecode.com/taglib/compressor" prefix="compress" %>
<compress:html enabled="true" removeComments="true" compressJavaScript="true">
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title><sitemesh:write property='title' /></title>
        <style type="text/css">
            <jsp:include page="/static/css/master.css"/>
            <jsp:include page="/static/css/header.css"/>
        </style>

因此,输出的HTML是压缩的,除了样式标记内的CSS。不是将所有内容放在一行中,而是将输出拆分(每个css位于新行上)

有人知道如何删除这些空白以便我可以将所有内容都放在一行中吗?

您可能希望在CSS文件上使用这些空白来压缩它们。