今天在做圖書查詢時,想讓查詢的條件通過GET的方式提交到相應的action里.
問題是中文數據提交到action里都成了亂碼.
用post提交時,并不會出現上面提到的亂碼問題.
請問該怎樣解決提交用GET提交的亂碼問題?
struts.xml已經設置了
<constant name="struts.i18n.encoding" value="GBK" />
JSP頁面也設置了
<%@ page language="java" contentType="text/html; charset=GBK"%>
<s:form action="search.action" method="get">
<input type="hidden" name="order" value="hit">
<table>
<tr>
<td><s:textfield label="書名" name="bookName"/></td>
</tr>
<tr>
<td><s:textfield label="作者" name="authorName"/></td>
</tr>
<tr>
<td><s:textfield label="出版社" name="publishName"/></td>
</tr>
<tr>
<td>
<s:select label="折扣" list="#{0:'請選擇折扣',1:'30折以上',2:'30折到50折',3:'50折到70折',4:'70折以下'}"
listKey="key" listValue="value">
</s:select>
</td>
</tr>
<tr>
<td align="center"><input type="submit" value="確定"></td><td align="center"><input type="reset" value="重新填寫"></td>
</tr>
</table>
</s:form>
在SearchAction里輸出查詢條件.比如說圖書名稱.在控制臺都成了亂碼
posted on 2007-11-22 14:14
Ke 閱讀(4198)
評論(4) 編輯 收藏 所屬分類:
問題區