Spring boot 如何在Freemarker中获取布尔变量调试?
如何查明项目是否处于调试模式,并在freemarker模板中获取逻辑类型的变量。Spring boot 如何在Freemarker中获取布尔变量调试?,spring-boot,spring-mvc,freemarker,Spring Boot,Spring Mvc,Freemarker,如何查明项目是否处于调试模式,并在freemarker模板中获取逻辑类型的变量。 示例: <#if (DEBUG)??> <script src="/static/jquery/jquery.js"></script> <#else> <script src="/static/jquery/jquery.min.js"></script> </#if>
示例:
<#if (DEBUG)??>
<script src="/static/jquery/jquery.js"></script>
<#else>
<script src="/static/jquery/jquery.min.js"></script>
</#if>
我使用equals运算符简化了相同的操作:
<#if DEBUG == true>
<script src="/static/jquery/jquery.js"></script>
<#else>
<script src="/static/jquery/jquery.min.js"></script>
</#if>