Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Grails 当然有内置的“if”和“else”标签,例如
<g:if test="${name == 'Fred'}"> Hello Fred, welcome back from your trip! </g:if> <g:else> Hello ${name} </g:else>
是否有可能纯粹使用 gsp 页面上的 ${} 功能来完成这样的事情?不使用
<g:if> and <g:else>
标签?
是的,例如像这样:
Hello ${name}${name == "Fred" ? ", welcome back from your trip!" : ""}