tomcat ,jsp 去空格

测试代码:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:set var="cfdate" value="2014-10-14"/>
<c:set var="cfsj" value="10:14"/>
<script type="text/javascript">
function showPolicy(){
	var cfdate='${cfdate} ${cfsj}';
	alert(cfdate);
}
showPolicy();	
</script>
${cfdate} ${cfsj}


tomcat 下的去空格配制:
    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
		<init-param>
            <param-name>trimSpaces</param-name>
            <param-value>true</param-value>
 		</init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>


结果是 2014-10-1410:14

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
		<init-param>
            <param-name>trimSpaces</param-name>
            <param-value>false</param-value>
 		</init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>




结果是 2014-10-14 10:14

你可能感兴趣的:(tomcat)