2
我遇到了搜索查詢的URL編碼問題,我在Velocity模板中有這個問題。HTML表單不編碼速度搜索的URL
<form method="GET" action="$req.contextPath/plugins/peopledirectory/search.action">
<div class="greyboxfill" style="width: 420px">
<input type="hidden" name="pageId" value="$pageId"/>
<input type="text" name="search" id="search" size="30" value="$search"/>
<input type="submit" name="searchbtn" value="Pesquisar">
</div>
</form>
的問題是,當我點擊提交按鈕,搜索字符串不URL編碼,如果我尋找的東西像我& A,它僅搜索ME。 Velocity有什麼定義需要這樣做嗎?
我在網上看到,表單HTML標籤有一個內部URL編碼,爲什麼它在這種情況下不起作用?
這看起來並不像有事情做與速度。你在瀏覽器的url字段中看到編碼數據嗎?我看到你的表單不是英文的,也許你用不同的編碼鍵入'&'字符,所以它不能識別它? – serg 2011-03-22 17:11:46