测试代码:
tomcat 下的去空格配制:
结果是 [b]2014-10-1410:14[/b]
结果是 [b]2014-10-14 10:14[/b]
<%@ 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>
结果是 [b]2014-10-1410:14[/b]
<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>
结果是 [b]2014-10-14 10:14[/b]