【发布时间】:2013-08-22 07:10:30
【问题描述】:
我正在尝试获取子字符串,但我得到了 Failed to execute the [velocity] macro。我不知道为什么会这样。这是我的代码:
#if ($text != '' )
#set ($textwo = "${text.substring(0,4)}")
if($textwo != "Tags" )
#getSearchResults()
(% class="search-results-container" %)(((
#displaySearchFacets($searchResponse)
(% class="search-results-left" %)(((
#displaySearchResultsSort()
#displaySearchResults()
)))
)))
#end
#if ($textwo == 'Tags')
#getTaggedResult
#end
#end
如果我删除#set ($textwo = "${text.substring(0,4)}") 行,我不会再收到错误,当然它也不起作用。
【问题讨论】: